Now that this is divorced from the devel project, the convenient toggle link that was in the devel block has been lost. Am I missing something, or should this be restored somehow, even if it's another block with one line in it to toggle the theme developer on and off.

As it is, I have to enable and disable the module every time. What a pain!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

squarecandy’s picture

I miss this too! Where is it?

ccshannon’s picture

Category: bug » feature

Though I greatly appreciate this incredible module, I am most unhappy about this change.

Given that Theme Developer breaks a lot of pages when it is active, I only use it for a few seconds at a time. It is a great annoyance to have to keep a separate tab open to the modules form to have to enable/disable this. Before, i had this toggle available to me at all times, right on the page, using Simplemenu or the Devel block.

This slows me down and adds time to my work.

Please put back this functionality as soon as is humanly possible. I consider its disappearance form the Devel block, a step backward. Thanks.

effulgentsia’s picture

Category: feature » bug

Agreed that this is a bug, and it is a casualty of separating the project from the rest of Devel. But the separation was needed, because Moshe, the maintainer of Devel, didn't have time to continue maintaining Theme Developer. I'll work on restoring this functionality.

ccshannon’s picture

Category: feature » bug

Thank you. Much appreciated! :)

gstout’s picture

Waiting for new release, truly, losing that link is debilitating to my theme dev speed. Thanks effulgentsia, looking forward to your fix.

Dr00py’s picture

FileSize
1.51 KB

Hi guys.

For all of you that you are missing that toggle link, here is a "quick and dirty" patch for Devel module (not Theme developer), that will bring it back (shamelessly copied from a previous version of Devel). This has to be considered temporary until it is implemented. in a better way.

druplicate’s picture

You can always roll back to the last integrated version of devel and theme developer, for the time being.

List of releases: http://drupal.org/node/3236/release

I think it's devel 6.x-1.18, not sure.

moshe weitzman’s picture

My 02

It is awkward to have to enable/disable the module all the time.We had 2 toggles; link for module disable, and a checkbox at bottom left. I think this whole UX needs re-think and re-code. So, adding back a link may not be best approach.

jmcoder’s picture

What would be ideal here is to allow it to be installed, but only produce output conditionally. This could hang an ajaxy thingy onto the Devel menu block that just toggles output on & off. This should be easy enough to do. Then when you're "really done" with theming you just disable the module completely.

jerseycheese’s picture

subscribing

masondib’s picture

subscribing

brack11’s picture

subscribing and supporting jmcoder

vegardjo’s picture

+1 subscribing

joetsuihk’s picture

sub

a toggle in admin_menu? ajax enable is "good to have" i think, coz we will have to reload the page anyway.

tylerh111’s picture

FileSize
1.13 KB

The tricky part, as noted in the comments of devel_themer.module, is that if devel_themer is disabled, how can it inject the menu item necessary to enable itself?

I suggest creating a separate module within the devel_themer package called "devel_themer_toggler". The toggle menu item and enable/disable logic moves to devel_themer_toggler. Then the developer will typically leave the devel_themer_toggler module enabled to provide the devel_themer toggle functionality.

I have attached a devel_themer_toggler implementation I adapted from the old code in the devel module. I currently have it sitting right alongside the devel_themer.* files within the devel_themer module folder. I am offering this as an alternative to Dr00py's "quick and dirty" patch offered in comment #6 above and as a possible solution to the issue.

ay13’s picture

very slick tylerh111, works well for me.

reubenavery’s picture

subcribe

nightowl77’s picture

Guys, just a suggestion....

I don't think it is necessary to create another module on top of devel_themer just to handle the toggle switch.

Why not just create another form item in /admin/settings/devel_themer looking like this

[ ] Enable Theme developer
[ ] Display theme log <------ Currently on Theme Developer's Settings page

Then a simple if (variable_get('theme_developer_enabled', FALSE) can be added to the function devel_themer_registery_alter. If the checkbox was ticked, themer would work like normal, otherwise it will not change the registry and will not add additional divs to your output

Code: not tested - it's just a representation of the idea I have :


/**
 * An implementation of hook_theme_registry_alter()
 * Iterate over theme registry, injecting our catch function into every theme call, including template calls.
 * The catch function logs theme calls and performs divine nastiness.
 *
 * @return void
 **/
function devel_themer_theme_registry_alter($theme_registry) {
  // For performance - immediately return if therer is not enabled
  if (variable_get('devel_therer_enabled', FALSE) return; 

  foreach ($theme_registry as $hook => $data) {
    if (isset($theme_registry[$hook]['function'])) {
      // If the hook is a function, store it so it can be run after it has been intercepted.
      // This does not apply to template calls.
      $theme_registry[$hook]['devel_function_intercept'] = $theme_registry[$hook]['function'];
    }
    // Add  our catch function to intercept functions as well as templates.
    $theme_registry[$hook]['function'] = 'devel_themer_catch_function';
  }
}

Please let me know if you like this idea. If there is enough interest I'll start rolling a patch.

dafeder’s picture

A strong vote for committing tylerh111's solution, at least until a more super and magical UX is concieved. A separate admin_menu item right next to "enable developer modules" would be nice also.

echoz’s picture

subscribe

adulfan’s picture

Just installed tylerh111's solutions, was totally lost with out it. It should be part of the devel module. I was working with this toggle and work but thought it was part of the devel by default and spent 30 minutes figuring out where it is, until came about it, here. Thank you tylerh111.

seanhellwig’s picture

Hey everybody, I created a simple module and bookmarklet that adds the toggle. I put it up on GitHub if anybody is interested.

http://github.com/seanhellwig/Drupal-Theme-Developer-Toggle-Module

Hope somebody finds this useful

KrisG’s picture

subscribe

shopdogg’s picture

subscribe

Andrew Schulman’s picture

subscribe

evelien’s picture

subscribe

ofktoubro’s picture

subscribe

Danny_Joris’s picture

subscribe

sebas5384’s picture

subscribe

jonathan1055’s picture

Thanks tylerh111 and nightowl77. The module in #15 works fine, but I also agree with #18 that it is a shame to have another separate module. The form tickbox item suggested could probably be made to work (although I've not verified the actual method used in devel_themer_theme_registry_alter) but it would require several clicks (admin -> settings -> devel themer, tick the box, save config, return to the page you wanted to check theming on). The beauty of the menu item is that if you have the devel block displayed then it is always only one click away and does not alter the page being viewed.

If there was a way to combine the ease of use of tylerh111 code into the existing devel_themer module, ie not disable the module but use the idea suggested by nightowl77 then that would be a good solution all round.

Jonathan

Adam Dyga’s picture

Module provided in #15 works fine and I don't think there is anything wrong with this approach. Actually devel_themer may be always shipped with the devel_themer_toggler sub-module, it does its job.

Denes.Szabo’s picture

I think there are another points of view: I am working on a big site. Not as big, but quite big. If you disable a module Drupal will rebuild the menu_router table.

On my devel computer it last 5 minutes! (Core2, 4G ram)

I just want make a theme for this site's subdomain. I need a really quick solution: enable/disable the devel_themer module themer part only, not the whole module.

So I am against the other toggler (sub) module. I think nightowl77 (#18) solution is the right way: quick toggle (in the admin module, for example), then, when I finished the theme part I disable the whole devel_themer.

Denes.Szabo’s picture

Status: Active » Needs review
FileSize
2.58 KB

I have just made a patch.

The menu item devel_themer/enabled and devel_themer/disabled seems to work. But it does not disable the devel_themer module now.

Please, test it! It based on nightowl77 (#18) work and idea.

jonathan1055’s picture

Following on from my comments in #30 I was about to start coding a hybrid version myself. Looks like you beat me to it. I'll gives yours a test right now.

Jonathan

jonathan1055’s picture

Thanks for making the patch. I've tested it, and it goes quite a way to getting what we want. NightOwl77's idea does work well and it will certainly allow the toggle feature to be controlled entirely within the devel_themer module, and without the actual module being completely enabled/disabled.

However there were a few things missing. The main problem was that you attempted to complete the idea started in the original which had two menu links with paths devel_themer/enable and devel_themer/disable. However this means that there is no menu link, only paths, so you had to type these urls manually. The ideal way to toggle the themer is to insert a link into the Devel menu just as we had when it was all one module (and like TylerH111 did).

I have taken your code, and used the menu manipulation of TylerH111, so we now have the best of both ideas. I have changed Devel_themer_toggle() so that it does not now have a parameter, because it should be a toggle - the action to take is determined by the current setting. Also drupal_rebuild_theme_registry() needs to be called when enabling the themer (at least, it is required to be called for the first time after installing)

I have also added a few standard function header boxes and included a few more comments. I'd like to know what you think, also TylerH111 and NightOwl77 - thank you for your code and ideas. I hope you agree with what we are now aiming for.

Jonathan

Denes.Szabo’s picture

It seems good, I will try it tomorrow. Thank you for your fixes and efforts. I think your lates patch does exactly what I need.

jonathan1055’s picture

Might be obvious, but just a reminder for anyone testing the patch in #35 - if you installed the devel_themer_toggle module from the zip file in #15 then you should disable that module, clear the cache and rebuild menus.

Denes.Szabo’s picture

I have an issue for your patch: even disable the themer I got a few span id="thmr-..."

So I think not enough to disable the theme registry alter to insert devel_themer module theme functions.

And rebuild the theme registry is expensive (slow on a big site). I think we should do:

1; devel_themer module enable. It rebuilds the theme registry once. But does nothing with the output.
2; themer enable: through the theme layer alters the page output.
3; devel_themer disable: cleans up the theme registry and the tmp files, variables.

I tried to write this, but it seems devel_themer_catch_function() should returns back a theme output without themer spans. A simply return if themer disabled not enough :)

Denes.Szabo’s picture

FileSize
5.88 KB

I seems at last I succesfully managed it. I attached a full patch against the dev.

Please test it!

jonathan1055’s picture

Yes you are right, there were thmr spans even after toggling off. I'd not spotted that, because the actual theme info pop-ups were working
correctly and disappearing after toggling off. This would have been fixed if we called drupal_rebuild_theme_registry() after both toggling on
or off, but you say that it is expensive on a site with many themes/modules, and I'm not in a position to disagree with you.

So, yes your new patch looks good to me, I've tested it and works fine. The changes you made are:
1. Call drupal_rebuild_theme_registry() in newly added hook_install()
2. Call drupal_rebuild_theme_registry() in hook_uninstall
3. Remove drupal_rebuild_theme_registry() from devel_themer_toggle()
4. Remove if (!devel_themer_enabled()) return from top of devel_themer_theme_registry_alter()
5. Add check on devel_themer_enabled() into condition inside devel_themer_catch_function()

I've learnt more now about how devel_themer intercepts theme calls. I think it would be good for someone else in the long thread of subscribers to test this before we mark it 'reviewed and tested'.

Jonathan
[edited for typos and formatting]

jonathan1055’s picture

Oh, I forgot to say that patches should be made from within that modules directory, not the next one up. I had to edit the patch and remove the /devel_themer from each of the +++ and --- lines to bring it in line with Drupal standards.

Denes.Szabo’s picture

Thank you for your review. But I do not want to take all credit for this patch - we worked on this together, not just me.

Patch: I made it in the modules dir not in the devel_themer. Because of it patches more files not just one. I do not know it is right or not, but I followed this instructions written there http://drupal.org/patch/create, the section titled: "Switches for the diff command".

jonathan1055’s picture

The instructions are slightly contradictory. In the paragraph you mention, I think it is more referring to comparing the directories for your info, although it does have > filename.patch at the end. But this is different from the paragraph earlier in the page named Check your directory which says

Contributed module/theme patches: Run the diff command in the module or theme's root directory. (Example: /sites/all/modules/foobar).

I think this is the more usually accepted way to make a patch. You have the original and the new file in the same directory. If you have changed more that one file, then patch each one and concatenate the output, for example this is how I made my patch:

cd sites/all/modules/devel_themer
diff -up devel_themer.install.orig  devel_themer.install  >  _753938.devel_themer.toggle_without_disable-d6.patch
diff -up devel_themer.module.orig   devel_themer.module   >> _753938.devel_themer.toggle_without_disable-d6.patch

The two >> on the second command cause the output to be appended to the same file. There are lots of ways to make patches, and yours was not wrong, it just caused me to have to edit the file before applying.

Hope that helps.
Jonathan

topdawg’s picture

subscribe

Eldon.T’s picture

Denes.Szabo your patch "devel_themer.753938_1.patch" seem to work fine here too.

i patched it on my linux with "patch -p1 < patchfile", within the /devel_themer directory to avoid any mismatch and it hasn't reported any problems or errors.

thx for your work.

JeremyFrench’s picture

Status: Needs review » Fixed

Patch commited here, thanks. I made one small change which was the default for devel_themer_enabled to be set to true, otherwise if people are not using the devel block theme developer disappears with no way to enable. Otherwise it is a great patch.

echoz’s picture

Status: Fixed » Needs work

Forgive me if reopening is inappropriate, and correct me if I'm missing something.

I believe this is not a fix for this issue, because this "toggle" (committed in #46) keeps theme developer checked on the modules page when it is "disabled" via the toggle link This results in an error from (I'm assuming) filefield, from an edit page with a filefield field, saying "Files may not be uploaded while the Theme Developer tool is enabled".

So after this update, I need to disable the module manually anyway. The submodule I was previously using, "devel_themer_toggler" from #15, actually toggled theme developer's checkbox off, and did not cause this conflict.

JeremyFrench’s picture

Status: Needs work » Fixed

Hi. Thanks for your feedback.

My feeling is that the patch as is solves the issue of theme developer markup breaking layout.

The issue with file uploads seems to be a specific issue where another module is disabling functionality based on theme developer being enabled.

This is either a separate bug in this module or in filefield.

Looking forward there may be user specific permissions for this module so a blanket enabled and disable will not do.

JeremyFrench’s picture

I have created #969684: Incompatibilty with filefield to look at why this is in filefield.

Status: Fixed » Closed (fixed)

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

jonathan1055’s picture

Title: Convenient toggle like before? » Enable/disable theme developer without install/uninstall

Changing the title to reflect the issue, and for better results when searching.
Apologies to everyone who has subscribed to this thread, and who will get informed of this trivial change :-)
Jonathan

voipfc’s picture

Category: bug » support
Status: Closed (fixed) » Active

Is this working with later releases of devel if it is committed into the devel module itself?

I can't see any sign of it after I upgraded? 6.x-1.26, 2011-Jul-22

voipfc’s picture

Status: Active » Closed (fixed)

I think it failed to work because jquery was not installed. Consider it fixed.