Just installed devel(7.x-1.x dev, 01/16) and devel_themer(7.x-1.x dev, 01/15) modules on drupal 7.x dev, dated 0/19. Only standard modules installed. Installed devel, then devel_themer. See following msg, though don't know affect. Clear cache removes msg momentarily until any page called.

Notice: Undefined index: preprocess functions in devel_themer_theme_twin() (line 512 of /Users/rocks/Sites/dru0119/sites/all/modules/devel_themer/devel_themer.module).

CommentFileSizeAuthor
#16 debugging-notices.patch801 byteskenneth.venken

Comments

JeremyFrench’s picture

Hi there. Thanks for reporting. Couple of questions.

What theme are you using for the front end? Are pages loading ok except for message?

dcrocks’s picture

I am building my own with bartik as the base. The pages seem to load ok but I've no real content yet. Just tried with bartik as theme and can't reproduce. Will see if I can dig deeper.

aimeee’s picture

Same error message, just installed / enabled Zen + created / enabled a sub-theme... using Zen 7.x-3.x-dev. All pages are loading fine except for the error message. Any pointers would be great.

JeremyFrench’s picture

Assigned: Unassigned » JeremyFrench

I can stop the error message showing easily enough by checking for the index. But I'm a bit worried it appears at all.

It looks like it is a side effect of sub theming. I'll try and investigate further.

aimeee’s picture

@Jeremy -can you go into more detail about what you did to check for the index? thanks!

I changed:

    $meta['suggestions'] = $suggestions;
    $meta['template_file'] = $template_file;
    $meta['preprocessors'] = $info['preprocess functions'];  //line 512

to:

    $meta['suggestions'] = $suggestions;
    $meta['template_file'] = $template_file;
    if (isset($info['preprocess functions'])) {
      $meta['preprocessors'] = $info['preprocess functions'];
    }

is that what you mean?

Punchy’s picture

Same as @ameee : same error message, just installed / enabled Zen + created / enabled a sub-theme... using Zen 7.x-3.x-dev.

cesarpo’s picture

I've got the same notice, and im not using a base theme., im developing the theme from scratch

marknr’s picture

I can provide Firebug debugging information about this - It happens reliably on my system, let me know if you would like it, and what you would find most useful.

mnr

localhost’s picture

This seems to occur when the theme folder contains extra template files. When I remove my custom node--node-type.tpl.php files and clear the cache, the error does not occur.

RobW’s picture

Localhost, by extra template files do you mean in-use-but-custom template overrides in the currently used theme folder, or unused tpls, like for a content type or nid that doesn't exist?

I'm having similar errors but the blog post here has me thinking all it is is that I printed some optional fields without an

 if (isset(field_xxx)) { ...
} 

check.

liam morland’s picture

This may be related to #1239562: Undefined index errors.

kenneth.venken’s picture

Could you add this to the devel_themer_theme_registry_alter function:

if (!isset($theme_registry[$hook]['preprocess functions']) || 
    !isset($theme_registry[$hook]['process functions'])) {
  var_dump($hook);
}

and post the output here.

dcrocks’s picture

Installed a clean copy of drupal 7.7 . Added latest copy of devel and devel_themer and enabled them. No error messages.
Copied and renamed bartik to sites/all/themes/barty, made it a subtheme of bartik, and then enabled it.

Removed trash. Tests were bad

dcrocks’s picture

Just scratch everything i wrote above except the test installation. Really distracted this morning and made several errors. Will try again.

dcrocks’s picture

Installed a clean copy of drupal 7.7 . Added latest copy of devel and devel_themer and enabled them. No error messages.
Copied and renamed bartik to sites/all/themes/barty, made it a subtheme of bartik, and then enabled it. No messages. Made it default, no messages
Of course I don't get error messages any more because of fix in #1239562: Undefined index errors. Where exactly do you want me to put that code and where should I see the results?

When are the files created in /tmp deleted?

kenneth.venken’s picture

StatusFileSize
new801 bytes

See attached patch for where you should place the code. This code should print the hooks which don't have any preprocess functions attached to them. (in your html).

Remember to clear you cache.

kenneth.venken’s picture

Ok, i copied all files from bartik to a new theme named barty. Changed the info file and references of bartik in template.php. => no notices
I created an extra template file: page--front.tpl.php, i cleared the cache. => no notices

kenneth.venken’s picture

Status: Active » Postponed (maintainer needs more info)
liam morland’s picture

I disabled a custom module and notices went away. Re-enabling that module, I can get rid of the notices by changing my implementation of hook_theme_registry_alter() to add NULL values for 'preprocess functions', 'process functions', and 'theme path'; previously, these properties had not been set. Since the values are now set, there are no more undefined index errors.

Other parts of the theme system check that these values are set before trying to use them. I think Theme developer should do the same, as implemented by my patch in #1239562: Undefined index errors.

kenneth.venken’s picture

It seems your right. In theme() they check for the (pre)processor functions too: (line 884)

if (isset($base_hook_info['preprocess functions']) || isset($base_hook_info['process functions'])) {

I'll reopen the other issue and close this one. Could you alter your patch so it uses isset() in stead of empty() so it is consistent with the rest of the code.

kenneth.venken’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)