The first two lines of the function devel_themer_toggle (devel_themer.module, ln 79-80) are:

  $function = $action == 'enable' ? 'module_enable' : 'module_disable';
  $$function('devel_themer');

If my understanding is correct the second line therefore equals

	$module_enable('devel_themer');

or:

	$module_disable('devel_themer');

which generates a fatal error (because of the dollar sign in front of the function name)

CommentFileSizeAuthor
#3 menu_items.patch1.57 KBkenneth.venken

Comments

ultimike’s picture

I agree with the double-dollar sign issue - it seems like it should only be a single dollar sign, but I also think there is a bigger issue at play.

Once the module is disabled, it is not possible to enable the module via the devel_themer/enable URL. With the module disabled, that menu path will never be registered...

-mike

kenneth.venken’s picture

Your right, devel_themer/enable will never work if the module is disabled.

What is the use case for these menu items? To quickly enable/disable the module? Or to prevent the spans's to be inserted? Because if the latter is the case, we could create a setting: "only insert spans when active" which would only insert the spans if the the "Theme info" checkbox has been checked. This will however require reloads of the page between toggles.

kenneth.venken’s picture

StatusFileSize
new1.57 KB

I think the enable/disable-urls are remnants of when devel_themer was still part of devel. So this patch removes them. I don't really see the point of them anyway.

kenneth.venken’s picture

Status: Active » Needs review
effulgentsia’s picture

Title: Function devel_themer_toggle » Remove devel_themer_toggle(), because a module can't enable/disable itself
Category: bug » task
Priority: Major » Normal
Status: Needs review » Fixed

Thanks. Committed to master branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.