Patch #7115

Improve Project methods to enable/disable modules

Added by Jean-Baptiste Barth about 8 years ago. Updated over 7 years ago.

Status:ClosedStart date:2010-12-15
Priority:NormalDue date:
Assignee:Jean-Baptiste Barth% Done:


Category:Code cleanup/refactoring
Target version:1.2.1


Enabling or disabling modules is not so easy now. It could be really useful when writing tests, doing modifications for many projects in a "script/console" (or "runner"), and of course in plugins. If nobody has an objection, I'm working it.

7115-improve-project-methods-to-enable-disable-modules.diff Magnifier (4.11 KB) Jean-Baptiste Barth, 2010-12-16 18:39

7115-improve-project-methods-to-enable-disable-modules-1.diff Magnifier (4.12 KB) Jean-Philippe Lang, 2010-12-20 21:23

Associated revisions

Revision 6098
Added by Jean-Baptiste Barth over 7 years ago

Added Project#enable_module! and Project#disable_module! (#7115)


#1 Updated by Jean-Philippe Lang about 8 years ago

That could look like Role#add_permission! and #remove_permission!

#2 Updated by Jean-Baptiste Barth almost 8 years ago

I was thinking about something a bit simpler to enable/disable module one by one. See proposal attached, tell me what you think.

#3 Updated by Jean-Philippe Lang almost 8 years ago

#disable_module! would destroy any object that is given as argument, safer version attached.

#4 Updated by Jean-Baptiste Barth over 7 years ago

  • Status changed from New to Closed
  • Target version set to 1.2.1
  • % Done changed from 0 to 100

Thanks for your answer, didn't see it before, sorry...

r5265 removed the need to use it in Project#enabled_module_names=, but I think these methods could be very useful in a shared hosting environment or in plugins. So I adapted the patch for current trunk and added it in r6098.

It will be safe for next minor version, the methods aren't used for the moment, so it cannot break anything.

#5 Updated by Etienne Massip over 7 years ago

  • Status changed from Closed to Reopened

Reopened for tracking, not merged into 1.2 branch.

#6 Updated by Jean-Baptiste Barth over 7 years ago

  • Status changed from Reopened to Closed

My mistake, sorry. I merged it in 1.2-stable with r6104. Thanks.

#7 Updated by Jean-Baptiste Barth over 7 years ago

Merged too many things with r6104, reverted in r6105, clean merge of this one is in r6106. Sorry for the noise.

Also available in: Atom PDF