Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

#8591 closed defect (fixed)

Can not disable components with EnvironmentStub

Reported by: Felix Schwarz <felix.schwarz@…> Owned by: Felix Schwarz <felix.schwarz@…>
Priority: normal Milestone: 0.12
Component: general Version: 0.11-stable
Severity: normal Keywords: testing
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The current implementation of EnvironmentStub uses its own implementation of is_component_enabled(). This simplified implementation does not allow disabling components.

Instead of creating another - broken - implementation, it is much easier (and reduces the overall code size) to fix the EnvironmentStub so that it can uses the real implementation in Environment.

Attachments (3)

use_real_is_enabled_function (1.5 KB ) - added by Felix Schwarz <felix.schwarz@…> 15 years ago.
use_real_is_enabled_function_v2 (3.3 KB ) - added by Felix Schwarz <felix.schwarz@…> 15 years ago.
improved version which deals with some test failures
use_real_is_enabled_function_v3 (4.7 KB ) - added by Felix Schwarz <felix.schwarz@…> 15 years ago.
updated version which fixes problems for external plugins

Download all attachments as: .zip

Change History (8)

comment:1 by Christian Boos, 15 years ago

Milestone: 0.12

Patch welcomed.

by Felix Schwarz <felix.schwarz@…>, 15 years ago

by Felix Schwarz <felix.schwarz@…>, 15 years ago

improved version which deals with some test failures

comment:2 by Christian Boos, 15 years ago

Milestone: 0.120.11.6
Owner: set to Felix Schwarz <felix.schwarz@…>
Severity: majornormal

Please also fix the tests which use the old way to enable components:

They are currently failing with the patch applied.

The following two also fail, certainly for similar reasons:

  • test_all_permissions (trac.tests.perm.PermissionSystemTestCase)
  • test_expand_actions_iter_7467 (trac.tests.perm.PermissionSystemTestCase)

comment:3 by Christian Boos, 15 years ago

Sorry, missed the second patch: that one passes all the tests for me. Is there still some other issues on your side, or is it good to go?

Also, I think normalize_configuration_key shouldn't be "public", maybe rename it to _normalize_configuration_key, or better, simply _component_name.

by Felix Schwarz <felix.schwarz@…>, 15 years ago

updated version which fixes problems for external plugins

in reply to:  3 ; comment:4 by Felix Schwarz <felix.schwarz@…>, 15 years ago

Replying to cboos:

Sorry, missed the second patch: that one passes all the tests for me. Is there still some other issues on your side, or is it good to go?

Also, I think normalize_configuration_key shouldn't be "public", maybe rename it to _normalize_configuration_key, or better, simply _component_name.

Somehow I missed the email of your comment, strage.

After all I found some problems in my second patch (only turning up for external plugins). From my side, there is not a real need anymore to put this in 0.11 so I'm happy also with milestone 0.12.

I renamed the function as you proposed, all tests are passing for me now :-)

in reply to:  4 comment:5 by Christian Boos, 15 years ago

Keywords: testing added
Milestone: 0.11.60.12
Resolution: fixed
Status: newclosed

Replying to Felix Schwarz <felix.schwarz@…>:

Somehow I missed the email of your comment, strage.

Well, I've also noticed that I didn't receive most of the notifications e-mails I should have received, since a week or so. It must be a problem with Postfix on lynx.edgewall.com. I'll inform Jonas about this.

After all I found some problems in my second patch (only turning up for external plugins). From my side, there is not a real need anymore to put this in 0.11 so I'm happy also with milestone 0.12.

Thanks for the patch, slightly edited (fit in 79 columns, remove prints) and committed as r8535.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Felix Schwarz <felix.schwarz@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Felix Schwarz <felix.schwarz@…> 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.