Mailing List Archive

trac.ini upgrade to Trac 1.4.1 results in new [mainnav] ordering
Hi,

I have a global trac.ini file that contains [mainnav] information. This
global ini file is read-only.

I also have a project specfic trac.ini file that is read-and-writable for
an older version of Trac that inherits the global ini file.

When I perform a trac-admin upgrade of the project specific file, the
process adds a new [mainnav] section (and a new [metanav] section) to the
project specific trac.ini file
- the new [mainnav] section contains different *.order values than my
global [mainnav] file
- this results in an unexpected tab ordering when I load it in my browser

Work around:
- If I comment out this new [mainnav] section in my project trac.ini file
then my project is displayed with the tabs in the expected order as per my
global trac.ini file
- No other changes are needed to get it to work properly

Question:
Is there a way to upgrade all of my 60 projects and keep my [mainnav] items
in the correct order as per my global trac.ini file?

Kindly,
Aikido Guy

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/d0abf82f-9424-4f86-9955-f2a25436139f%40googlegroups.com.
Re: trac.ini upgrade to Trac 1.4.1 results in new [mainnav] ordering [ In reply to ]
On Friday, May 29, 2020 at 7:00:37 PM UTC-7, Aikido Guy wrote:
>
> Hi,
>
> I have a global trac.ini file that contains [mainnav] information. This
> global ini file is read-only.
>
> I also have a project specfic trac.ini file that is read-and-writable for
> an older version of Trac that inherits the global ini file.
>
> When I perform a trac-admin upgrade of the project specific file, the
> process adds a new [mainnav] section (and a new [metanav] section) to the
> project specific trac.ini file
> - the new [mainnav] section contains different *.order values than my
> global [mainnav] file
> - this results in an unexpected tab ordering when I load it in my browser
>
> Work around:
> - If I comment out this new [mainnav] section in my project trac.ini file
> then my project is displayed with the tabs in the expected order as per my
> global trac.ini file
> - No other changes are needed to get it to work properly
>
> Question:
> Is there a way to upgrade all of my 60 projects and keep my [mainnav]
> items in the correct order as per my global trac.ini file?
>
> Kindly,
> Aikido Guy
>

In Trac < 1.2, the order is configured through the [trac] mainnav and
[trac] metanav entries:
https://trac.edgewall.org/wiki/1.0/TracNavigation#nav-order

The db41 upgrade steps writes these to [mainnav] and [metanav] sections:
https://trac.edgewall.org/browser/tags/trac-1.4.1/trac/upgrades/db41.py

If you are upgrading from Trac < 1.2 your mainnav and metanav ordering
should be configured in the [trac] mainnav and [trac] metanav options.

It likely fails to account for the possibility that [trac] mainnav and
[trac] metanav are configured in an inherited config file. In that case, it
should issue a warning message and not modify the env trac.ini file.

However, since that won't get fixed until at least trac.1.4.2, you'll need
a different solution.

Unfortunately it's also try that "trac-admin $env config remove mainnav"
does not remove the mainnav section.

Instead, you'll have to remove each option:

for opt in wiki ticket newticket timeline roadmap browser search admin
do
trac-admin $env config remove mainnav $opt.order
done

When the last section option is removed, the section header [mainnav] will
also be removed.

* https://trac.edgewall.org/ticket/13305
* https://trac.edgewall.org/ticket/13306

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/af663a44-0b77-41de-b073-7d46e4da5f04%40googlegroups.com.
Re: trac.ini upgrade to Trac 1.4.1 results in new [mainnav] ordering [ In reply to ]
On Friday, May 29, 2020 at 7:45:08 PM UTC-7, RjOllos wrote:

A few clarifications.

On Friday, May 29, 2020 at 7:00:37 PM UTC-7, Aikido Guy wrote:
>>
>> Hi,
>>
>> I have a global trac.ini file that contains [mainnav] information. This
>> global ini file is read-only.
>>
>> I also have a project specfic trac.ini file that is read-and-writable for
>> an older version of Trac that inherits the global ini file.
>>
>> When I perform a trac-admin upgrade of the project specific file, the
>> process adds a new [mainnav] section (and a new [metanav] section) to the
>> project specific trac.ini file
>> - the new [mainnav] section contains different *.order values than my
>> global [mainnav] file
>> - this results in an unexpected tab ordering when I load it in my browser
>>
>> Work around:
>> - If I comment out this new [mainnav] section in my project trac.ini file
>> then my project is displayed with the tabs in the expected order as per my
>> global trac.ini file
>> - No other changes are needed to get it to work properly
>>
>> Question:
>> Is there a way to upgrade all of my 60 projects and keep my [mainnav]
>> items in the correct order as per my global trac.ini file?
>>
>> Kindly,
>> Aikido Guy
>>
>
> In Trac < 1.2, the order is configured through the [trac] mainnav and
> [trac] metanav entries:
> https://trac.edgewall.org/wiki/1.0/TracNavigation#nav-order
>
> The db41 upgrade steps writes these to [mainnav] and [metanav] sections:
> https://trac.edgewall.org/browser/tags/trac-1.4.1/trac/upgrades/db41.py
>
> If you are upgrading from Trac < 1.2 your mainnav and metanav ordering
> should be configured in the [trac] mainnav and [trac] metanav options
>

Meaning, the inherited config file you used with Trac < 1.0 should have
defined the ordering using the [trac] mainnav and [trac] metanav options


> It likely fails to account for the possibility that [trac] mainnav and
> [trac] metanav are configured in an inherited config file. In that case, it
> should issue a warning message and not modify the env trac.ini file.
>

To the point, there is a defect in the upgrade step that will be dealt with
in #11306

However, since that won't get fixed until at least trac.1.4.2, you'll need
> a different solution.
>
> Unfortunately it's also tr[ue] that "trac-admin $env config remove
> mainnav" does not remove the mainnav section.
>
> Instead, you'll have to remove each option:
>
> for opt in wiki ticket newticket timeline roadmap browser search admin
> do
> trac-admin $env config remove mainnav $opt.order
> done
>
> When the last section option is removed, the section header [mainnav] will
> also be removed.
>
> * https://trac.edgewall.org/ticket/13305
> * https://trac.edgewall.org/ticket/13306
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/45275fbe-504d-4dc6-88c6-43da6ef2190e%40googlegroups.com.
Re: trac.ini upgrade to Trac 1.4.1 results in new [mainnav] ordering [ In reply to ]
On Friday, May 29, 2020 at 11:47:09 PM UTC-4, RjOllos wrote:

> On Friday, May 29, 2020 at 7:45:08 PM UTC-7, RjOllos wrote:
>
>> On Friday, May 29, 2020 at 7:00:37 PM UTC-7, Aikido Guy wrote:
>>>
>>> I have a global trac.ini file that contains [mainnav] information. This
>>> global ini file is read-only.
>>>
>>
I should have also mentioned that:
(1) I created a test environment from scratch and got it to work
(2) I manually modified all entries in my global ini file

I also have a project specfic trac.ini file that is read-and-writable for
>>> an older version of Trac that inherits the global ini file.
>>>
>>
(3) All of my project specific ini files are read-writable and I let the
upgrade process rewrite them as needed

When I perform a trac-admin upgrade of the project specific file, the
>>> process adds a new [mainnav] section (and a new [metanav] section) to the
>>> project specific trac.ini file
>>> - the new [mainnav] section contains different *.order values than my
>>> global [mainnav] file
>>> - this results in an unexpected tab ordering when I load it in my browser
>>>
>>> Work around:
>>> - If I comment out this new [mainnav] section in my project trac.ini
>>> file then my project is displayed with the tabs in the expected order as
>>> per my global trac.ini file
>>> - No other changes are needed to get it to work properly
>>>
>>> Question:
>>> Is there a way to upgrade all of my 60 projects and keep my [mainnav]
>>> items in the correct order as per my global trac.ini file?
>>>
>>> In Trac < 1.2, the order is configured through the [trac] mainnav and
>> [trac] metanav entries:
>> https://trac.edgewall.org/wiki/1.0/TracNavigation#nav-order
>>
>> The db41 upgrade steps writes these to [mainnav] and [metanav] sections:
>> https://trac.edgewall.org/browser/tags/trac-1.4.1/trac/upgrades/db41.py
>>
>> If you are upgrading from Trac < 1.2 your mainnav and metanav ordering
>> should be configured in the [trac] mainnav and [trac] metanav options
>>
>
> Meaning, the inherited config file you used with Trac < 1.0 should have
> defined the ordering using the [trac] mainnav and [trac] metanav options
>
>
>> It likely fails to account for the possibility that [trac] mainnav and
>> [trac] metanav are configured in an inherited config file. In that case, it
>> should issue a warning message and not modify the env trac.ini file.
>>
>
> To the point, there is a defect in the upgrade step that will be dealt
> with in #11306
>
> However, since that won't get fixed until at least trac.1.4.2, you'll need
>> a different solution.
>>
>> Unfortunately it's also tr[ue] that "trac-admin $env config remove
>> mainnav" does not remove the mainnav section.
>>
>> Instead, you'll have to remove each option:
>>
>> for opt in wiki ticket newticket timeline roadmap browser search admin
>> do
>> trac-admin $env config remove mainnav $opt.order
>> done
>>
>> When the last section option is removed, the section header [mainnav]
>> will also be removed.
>>
>> * https://trac.edgewall.org/ticket/13305
>> * https://trac.edgewall.org/ticket/13306
>>
>
Thank you for the for loop above and the comment below it. I added such a
thing after the upgrade in order to "corrrect" my project specific ini
files.
- I just tested this process on one of my projects and it works as
advertised...

Thank you kindly!
Aikido Guy

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/83d86000-ea4d-4125-9bfc-5435d5891928%40googlegroups.com.