I maintain a site that uses a subtheme of adaptive theme. Since updating to Drupal 7.77, my PHP error log files have been filling up with the following errors:
PHP Fatal error: Uncaught Error: Call to undefined function user_is_logged_in() in {site-root}/sites/all/themes/adaptivetheme/at_core/inc/load.inc:23
Stack trace:
#0 {site-root}/sites/all/themes/adaptivetheme/at_core/inc/load.inc(526): at_load_failure('public://adapti...', '{subtheme-name}')
#1 {site-root}/sites/all/themes/adaptivetheme/at_core/inc/load.inc(92): at_load_conditional_styles('public://adapti...', Array, '{subtheme-name}')
#2 {site-root}/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc(980): at_load_layout_css('public://adapti...', '{subtheme-name}')
#3 {site-root}/includes/theme.inc(1125): adaptivetheme_preprocess_maintenance_page(Array, 'maintenance_pag...')
#4 {site-root}/includes/errors.inc(254): theme('maintenance_pag...', Array)
#5 {site-root}/includes/bootstrap.inc(2623): _drupal_log_error(Array, true)
#6 [internal function]: _drupal_exception_handler(Object(PDOException))
#7 {main}
thrown in {site-root}/sites/all/themes/adaptivetheme/at_core/inc/load.inc on line 23
It would seem, looking at line 23 of load.inc, that at_core cannot find some resources that it needs.
Longer term, I need to debug this, and find out what CSS files are missing, or what else the problem might be.
However, whatever problem I've got, Adaptive Theme is using the core function user_is_logged_in
to determine if the site is running anonymously. If there is a logged in user, then drupal_set_message
would be called to display the message on screen.
For some reason, Adaptive Theme cannot see that the core function user_is_logged_in
exists, so the error gets thrown in the PHP log.
Proposed Solution
Long-term, it would be good if someone could find out why a core function is not visible. It may be to do with the place in the bootstrap process at which the error occurs.
Medium-term, these errors could probably be solved by using function_exists(user_is_logged_in) && user_is_logged_in()
instead of simply calling user_is_logged_in
.
Short-term, I don't want this error reported on screen to logged-in users, so the simplest solution is simply to let Adaptive Theme report the error in watchdog (which it already does), and remove the code that possibly displays it as an on-screen message.