Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
theme system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2007 at 11:00 UTC
Updated:
10 Sep 2012 at 18:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Wesley Tanaka commentedIt appears that theme_get_function (where init_theme() is getting called) is passed 'placeholder'?
Comment #2
Wesley Tanaka commentedIn case it makes a difference, I have xdebug installed (which has its own pretty printing error handler)
The notice:
Notice: Undefined property: stdClass::$theme in ...../theme.inc on line 45
is being produced by drupal's error_handler() function while it was trying to tell me about some other warning. Something like the following module should be able to reproduce the bug if you go to the 'bug109459' path without any arguments. That produces a "missing function argument" warning, which then gets overridden by the described notice.
function mymodule_menu() { return array( array('path' => 'bug109459', 'title' => t('something'), 'callback' => '_mycallback', 'access' => user_access('access content')), ); } function _mycallback($input) { include dirname(__FILE__).'/somefile.inc.php'; return callback($input); }Comment #3
jeffabailey commentedI am experiencing the same problem although it is while running the cron using wget. I am not getting it with anonymous users just from the cron.
Comment #4
jeffabailey commentedOh... and I am getting this error with the release version of drupal 5.0.
Comment #5
hawkdrupal commentedI have the same error with Drupal 5.1. No clue what triggered it.
But, I also lost all views content. The view content disappeared at the same time the error appeared. How could these be related?
I resaved and even redesigned some views, but they still don't show any content.
Comment #6
TinTin_Pinguin commentedThe "Undefined property: stdClass::$theme" error message appear when activating the textimage plugin.
When this is desabled, no error.
Comment #7
TinTin_Pinguin commentedWell, if in the "background" directory (textimage), we have a file bg.JPG, the error is there.
If the file name is bg.jpg (lowercase), the error is gone.
Hope this helps.
Have no idea howto submit this bug on the textimage (ifthere is the problem), since is no textimage in the dropdown list.
Hope somebody can forward to the right developer.
Thanks.
Comment #8
andjules commented+1 > I am getting this error too. Seems to be around a file not found... but better error reporting on this one would be much more helpful
Comment #9
couloir007 commentedWe had this issue when registering new users. Check your `sequences` table. We had a dev Drupal DB with maybe 20 users. Then imported 300 users from our amember db, and went live. At this point, `uid` shot up to over 300, but internally, Drupal was up to around 30 in the `sequences` table. This was problematic. We updated `sequences` to 1 higher than our highest `uid`, and now all is well.
Comment #10
cgfoz commentedI had this when migrating an installation.
Probably not getting to the root of this problems, but changing line 45 to
did the trick for me
Comment #11
wim leersThe change in #10 works as advertised.
Comment #12
c960657 commentedIt appears to happen when an error occurs.
Here is a stack trace produced by manually triggering an E_USER_NOTICE in a custom module:
Notice: Undefined property: stdClass::$theme in /home/dr/www/drupal/includes/theme.inc on line 45
Because this error happens from within the error handler, it does not invoke the error handler again. Instead PHP just sends the error message to the user (if the display_errors ini setting is true) and writes a line in the error log.
When this error occured, $user contained the following:
I also sometimes get another error in the same method, "Trying to get property of non-object" in theme.inc line 58 (this line reads:
if (strpos($themes[$theme]->filename, '.css')) {), but that may be unrelated to this issue.Comment #13
sir_kula commentedBetter solution is in bootstrap.inc on line 828 change function drupal_anonymous_user() to:
Add variable $data and $theme.
Comment #14
chx commentedSince when 5.X is notice free?
Comment #15
c960657 commented5.X isn't notice free, but almost all notices are muted by the built-in error handler (in common.inc). The error described in this issue is one of the few that are not caught by the error handler (because it happens after the error handler has kicked in due to another error).
Comment #16
chx commentedWell, then let's try fixing it, adding to the anonymous user is a good idea, but theme and data needs to be the empty string, not NULL .
Comment #17
dvessel commentedDoesn't this just need a back port? It's fixed in D6.
http://api.drupal.org/api/function/init_theme/6
Comment #18
drummCommitted to 5.x.
Please keep backport patches in the same original issue in the future.
Comment #19
dvessel commentedI believe it was part of a bigger patch and due to the huge theming changes, it got overlooked.
Comment #20
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #21
suit4 commentedThis problem still exists with Drupal 5.7, in my case only when using Opera or Konqueror (KDE4) on my site.
Using Firefox did NOT reproduce the error - which is definitly strange.
The patch seem to cure the problem.
Comment #22
asimmonds commented@suit4 - This patch was committed to 5.x-dev after 5.7 was released, it will be included in 5.8 and later releases.
Comment #23
suit4 commentedasimmonds thanks for the notification!
Comment #24
yan commentedJust to let you know: I got the same error message in a 5.7 install when I used a custom module where I called
in_array('user role',$user->roles). I forgot to setglobal $user;before. When I did, the message didn't show anymore.Comment #25
angad_singh commentedI had the very same problem.
Here's the problem as well as the solution :)
http://drupal.org/node/277798
Comment #26
kingandyFWIW, I was able to resolve this error message by clearing the views cache.
I think the message itself may be a symptom of a large number of different possible problems...
Comment #27
demeester_roel commentedThe change in #10 works as advertised.
BTW .. This is just a symptom of other problems. (in our case views cache).
But it's also a symptom of bad coding habits in drupal.
I've seen this happening in many place. Using arrays/objects/elements without ever checking if it contains data.
In Java you'd get NullPointerExceptions which should ALWAYS be catched, in PHP you'll get these strange errors.
ps. Note to myself: 'Make sure that I do what i've evangelized' :)
Comment #28
tharakan commentedThe issue seems similar to what demeester_roel mentioned above (in #27) .i.e using uninitialized variables without checking for their values / assigning them any values first.
This is the first page load (ever) of any drupal system on this system. It has the following:
PHP Version 5.4.6
Apache Version Apache/2.4.2 (Win32) PHP/5.4.6
Loaded Modules core mod_win32 mpm_winnt http_core mod_so mod_access_compat mod_actions mod_alias mod_allowmethods mod_asis mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_dir mod_env mod_include mod_isapi mod_log_config mod_mime mod_negotiation mod_rewrite mod_setenvif mod_php5