Notices thrown in template.php

Notice: Use of undefined constant skinr - assumed 'skinr' in mothership_preprocess() (line 362 of /data/sites/mysite/htdocs/sites/all/themes/contrib/mothership/template.php).

Patch corrects cases where module_exists() was passed a constant instead of a string.

Comments

coltrane’s picture

StatusFileSize
new3.78 KB

Found some more.

coltrane’s picture

StatusFileSize
new8.1 KB

Found more having to do with theme settings. When the constant isn't defined PHP attempts to use it as a string, which is why this never popped up before.

By the way, http://randyfay.com/node/76 is what anyone who writes PHP (even in themes) should read and follow.

Also finding notices "Array to string conversion" from mothership_id_safe(). I think it's because mothership_table() is passing $cell over for an ID sometimes and it's an array. Will tackle in moment.

coltrane’s picture

Title: Notices in template.php » PHP Notices in mothership theme
coltrane’s picture

StatusFileSize
new9.03 KB

And this one includes a fix for
Warning: strtolower() expects parameter 1 to be string, array given in mothership_id_safe() (line 13 of /data/sites/site/htdocs/sites/all/themes/contrib/mothership/template/template.functions.php).

lazysoundsystem’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new8.99 KB

Thanks for these fixes - the patch added below is exactly the same, only made with --no-prefix for compatibility with drush_make.

(And with trailing whitespace removed from the changed lines - there are other lines still with trailing whitespace.)

lazysoundsystem’s picture

StatusFileSize
new9.31 KB

And this patch also fixes these two:

Notice: Undefined index: node in mothership_preprocess() (line 142 of .../sites/all/themes/mothership/template.php).
Notice: Trying to get property of non-object in mothership_preprocess() (line 142 of /var/www/drupal6-ukgbc/sites/all/themes/mothership/template.php).
realityloop’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (won't fix)

If this is still an issue in D7 please re-open and update the version in issue metadata