Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2204 closed defect (fixed)

WebAdmin plugin enabling is reversed

Reported by: Pedro Algarvio <ufs@…> Owned by: Christopher Lenz
Priority: normal Milestone:
Component: general Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I found no other place to submit a but for the WebAdmin plugin, so I've submited it here, hopefully on the right place, I just think there should be a "component" for it.

Well, here's my prob, when trying to disable a trac feature with webadmin, namely trac.milestone.milestonemodule and trac.roadmap.roadmapmodule, here's what happens on the env's trac.ini:

[components]
trac.milestone.milestonemodule = enabled
trac.roadmap.roadmapmodule = enabled

when it should be:

[components]
trac.milestone.milestonemodule = disabled
trac.roadmap.roadmapmodule = disabled

So I guess the default behaviour when disabling "parts" with the WebAdmin plugin is wrong. No matter how many times I try to disable a "part/feature" it always writes enabled on trac.ini, and I always have to edit it by hand to change the value.

Hum, and to try the oposite, enable a disabled component, the most awkward thing happened. I enabled trac.milestone.milestonemodule, and here's what happened on trac.ini:

[components]
trac.milestone.milestonemodule = disabled
trac.roadmap.roadmapmodule = enabled

My trac is on revision is 2344 and the webmin is on 2340, the most current for today, 11/out/2005.

Attachments (0)

Change History (4)

comment:1 by Pedro Algarvio <ufs@…>, 19 years ago

Summary: Webadmin plug wrong default behaviourWebAdmin plug wrong default behaviour

comment:2 by Matthew Good, 19 years ago

Summary: WebAdmin plug wrong default behaviourWebAdmin plugin enabling is reversed

The behavior here is reversed, since the variable is_enabled reflects whether the component is currently enabled, so the setting should be flipped:

  • webadmin/plugin.py

     
    136136        for component in components:
    137137            is_enabled = self.env.is_component_enabled(component)
    138138            if is_enabled != (component in enabled):
    139                 if is_enabled:
    140                     self.config.set('components', component, 'enabled')
    141                 else:
    142                     self.config.set('components', component, 'disabled')
     139                self.config.set('components', component, is_enabled and \
     140                        'disabled' or 'enabled')
    143141                self.log.info('%sabling component %s',
    144142                              is_enabled and 'Dis' or 'En', component)
    145143                changes = True

comment:3 by Christopher Lenz, 19 years ago

Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

comment:4 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [2348].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.