When I enable the theme developer module and click around, the Drupal Themer Information box shows all the relevant data except the variables. It just says ...NULL. But, while no error message is displayed, with each click, my reports page gets another error:
Notice: Undefined index: thmr_33 in devel_themer_ajax_variables() (line 40 of C:\wamp\www\local.nfsgunex.com\sites\all\modules\contrib\devel_themer\devel_themer.module).
Notice: Undefined index: thmr_13 in devel_themer_ajax_variables() (line 40 of
C:\wamp\www\local.nfsgunex.com\sites\all\modules\contrib\devel_themer\devel_themer.module).
Notice: Undefined index: thmr_16 in devel_themer_ajax_variables() (line 40 of C:\wamp\www\local.nfsgunex.com\sites\all\modules\contrib\devel_themer\devel_themer.module).
Perhaps these have something to do with why the variables are not returned?
If I change line 39 from:
if ($data = unserialize(file_get_contents($file))) {
to:
if ($data == unserialize(file_get_contents($file))) {
then the output for variables changes from NULL to:
Ajax variables file not found. -temporary://devel_themer_184834fb1b80ab239d
I only tried that because Netbeans IDE suggested it, but obviously it did not help.
Theme developer 7.x-1.x-dev
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | devel_themer-1578754-14.patch | 668 bytes | berdyshev |
| #11 | krumo-before-serialize-1578754-11.patch | 2.14 KB | kenneth.venken |
| #9 | 404-errors-loading-vars-1578754-9.patch | 896 bytes | kenneth.venken |
| #6 | unable-to-view-vars-1578754-6.patch | 1.41 KB | kenneth.venken |
| #5 | devel_themer.zip | 7.58 KB | alexus2005 |
Comments
Comment #1
JSCSJSCS commentedI discovered after a little more testing that if I uncheck the themer info box, go to the page of interest, then clear all cache, then recheck the themer info box and click on an item to get info, them it works. but changing to another page breaks it again. But if I repeat the process (Uncheck themer info box, refresh page/go to page, clear cache, recheck themer info box) then I can get Themer data on items on that page.
Hope this helps.
Comment #2
mkolar commentedI have the same problem, no vars.. But in some cases appear.
Comment #3
alexus2005 commentedI got exactly the same issue. I was able to use Theme Developer module before. Recently this started and I am stuck.
I am using WAMP environment. It works in Rubik on admin pages, but doesn't work in my custom theme for some reason.
Comment #4
alexus2005 commentedAlright, After some investigation, here is what found.
Basically the problem arises because of Heartbeat Module.(In my case at least).
When I inspected the Drupal.settings object in firebug:
If Heartbeat and Theme Developer are enabled - the Drupal.settings is missing all the thmr_# properties. Only ThmrString is there.
If Heartbeat is disabled, the thmr_#s are there and everything works fine.
Investigating, but help would be appreciated. Cheers.
Comment #5
alexus2005 commentedFIXED finally... the patch is attached. It's a very weird way of solving this issue, but I hope you guys can help to come up with better one.
Problem Root:
When a page is loaded, Theme Developer module will grab all the data it recorded and save it to the TMP folder. When saving the array of data is serialized. The problem is that Heartbeat and some other modules contain PDO object in them, which can not be serialized. So the whole saving will not work.
Current "Ugly" Solution:
Before serializing the array, I placed a block of code try serialize each of the array members, if the serialization passed, the element gets added back into the array. Those that contain PDO object, don't get back into the array. Solves the problem, but is an ugly solution. [The idea is to check of there is a PDO object anywhere and remove it from the array of data to serialize.]
Cheers, the working module is attached.
Comment #6
kenneth.venken commentedAttached is #5 as a patch.
Comment #7
jonathan_hunt commentedPatch works for me, thanks.
Comment #8
jonathan_hunt commentedAfter using the site some more, I'm still getting 404 errors loading the vars, so this patch doesn't resolve the issue...
Comment #9
kenneth.venken commentedAttached is a patch which should fix the 404 warnings.
It doesn't try to serialize the individual array members as suggested in #4. So if any variable in any hook containes a PDO object, a message 'Unable to load variables, probably due to PDO.' will be shown.
Comment #10
kenneth.venken commentedCould someone review #9
Comment #11
kenneth.venken commentedDuring the rendering phase, we serialize the variables and store them to a file. Then we will use ajax calls to fetch the variables for a specific hook. The ajax code will load the file, unserializes the file, run krumo on the variables and return the krumo output to the user.
Why can't we run krumo before we serialize the variables. Then in the ajax-phase, we just unserialize the file and return the krumo-output. Attached is a quick patch that does just that.
I'd like to get some feedback on this approach.
Comment #12
robcarrI've tried the patch at #11 which applied (although hunk 2 was offset by 3 lines, so I may be on a different version of DEV).
I'm still getting the 404 errors (on URLs such as /devel_themer/variables/1675363517502275afcc87c/thmr_68) when trying to list the variables. Not sure if I have any other module conflicts. Tried the suggestion at #1, but this hasn't helped either.
Comment #13
berdyshev commentedHi to all,
I have installed last dev version from the git repo. and I get the same error - 404 for path
devel_themer/variables/.....But I think that a bug isn't in callback code, but in menu route defenition. Because in case of bug in callback definition we would see the 500 error or something like this.
will debug and try to fix it.
Comment #14
berdyshev commentedyes, I was right, issue is in menu route definition.
and here is the patch. please review it.
Comment #15
kenneth.venken commented@BerdArt: Good catch. Committed to 7.x.1.x.
Haven't been able to reproduce the 404 errors yet, so i'll leave it 'on needs review' for now until someone confirms that this fixes the issue.
Comment #16
kenneth.venken commentedThe issue described in #5 will be tracked in #1865070: Some variables can't be serialized causing 404 errors.
Comment #17
kenneth.venken commented