Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting a bunch of PHP errors every time the cron runs. I can't seem to track down what is causing them all, but one of the is this:
Warning: Cannot use a scalar value as an array in adaptivetheme_page_alter() (line 235 of /var/www/vhosts/tlthost.net/httpdocs/sites/all/themes/at_core/inc/alter.inc).
I'm hoping maybe if you folks know what's causing this one, it might help me figure out the rest of the errors.
Comment | File | Size | Author |
---|---|---|---|
#10 | cant_use_scalar_value.png | 4.01 KB | kalidasan |
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentedCan you post all the errors, or a bunch of them - that one is coming from adaptivetheme_page_alter(), it calls at_get_browser() which is a wrapper for browscap_get_browser and should return true/false not an array so no need to initialize $page['is_mobile'] as an array. Weird.
Comment #2
wxman CreditAttribution: wxman commentedHere's what I get:
The last one, array in block_page_build() line 269, comes up 4 or 5 times.
I thought I tracked it down to something in my template.php, but that didn't pan out.
Comment #3
Jeff Burnz CreditAttribution: Jeff Burnz commentedI can't really see this as a theme issue, if you look most of the notices are coming from things within Drupal core, I would try clearing your cache and possibly saving some module and theme settings again, you can see facebook connect has a problem also - but these are not typical issues or bugs I would think, just an odd problem with your installation.
Comment #4
deanflory CreditAttribution: deanflory commentedI'm getting these as well in my log but not as a warning/error on a page:
I am using a custom/starter subtheme of AdaptiveTheme but it looks like it may be something else, dunno, just posting here as I just noticed these showing up in my log and haven't been able to find anywhere else they're mentioned.
If it's of any help, I'm currently trying to track down why I'm also having issues with batch operations (all but module update checking) not showing up and performing, therefore failing but without any error message, just no progress bar or progress but the page does completely load.
Comment #5
wxman CreditAttribution: wxman commentedI took Jeff's advice and re-saved a bunch of the modules, but that didn't help. It really is a mystery.
Comment #6
inst CreditAttribution: inst commentedHi,
I am working with AT too.
And got the same errors - without tellinig now, that is because I use AT.
Anyway, I will do some test and try to find out what is going oin behind that PHP messages.
best,
fr
Comment #7
Jeff Burnz CreditAttribution: Jeff Burnz commentedCan you guys tell me which version of Browscap you are using, if any?
Comment #8
Jeff Burnz CreditAttribution: Jeff Burnz commentedI might suggest that in get.inc in the core theme (look in adaptivetheme/at_core/inc/get.inc) right down the bottom of that file look for the function:
at_get_broswer()
and replace the line:
if ($browser['ismobiledevice'] == 1)
with...
if ($browser['ismobiledevice'] == TRUE)
Comment #9
wxman CreditAttribution: wxman commentedI'm using browscap 7.x-1.3
Comment #10
kalidasan CreditAttribution: kalidasan commentedHi I have created one menu call back in my custom module.
When i removed "return TRUE;" from my function, this error went away.
So if you are running any function in your cron, please check its return value. If its not necessary remove it.
It may fix your issue.
Please find my attachment for error details.
Error details :
Warning: Cannot use a scalar value as an array in admin_menu_page_build() (line 166 of /app/mysite/public_html/sites/all/modules/contrib/admin_menu/admin_menu.module).
Comment #11
deanflory CreditAttribution: deanflory as a volunteer commentedI take it this is fixed in the current version of AdaptiveTheme as I'm unable to find
if ($browser['ismobiledevice'] == 1)
but do see a section like this:
EDIT: scalar error source found and vanquished.
Comment #12
deanflory CreditAttribution: deanflory as a volunteer commented