The update from 3.x to 3.0 resulted in a white screen and the following fatal error:
Fatal error: [] operator not supported for strings in /home/drupalpro/websites/puravida.dev/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc on line 853 Call Stack: 0.0000 327832 1. {main}() /home/drupalpro/websites/puravida.dev/index.php:0 0.0884 4392156 2. menu_execute_active_handler() /home/drupalpro/websites/puravida.dev/index.php:21 0.0886 4392804 3. call_user_func_array() /home/drupalpro/websites/puravida.dev/includes/menu.inc:516 0.0886 4392996 4. node_page_default() /home/drupalpro/websites/puravida.dev/includes/menu.inc:0 0.0969 4407320 5. node_load_multiple() /home/drupalpro/websites/puravida.dev/modules/node/node.module:2592 0.0969 4407604 6. entity_load() /home/drupalpro/websites/puravida.dev/modules/node/node.module:909 0.0989 4470700 7. DrupalDefaultEntityController->load() /home/drupalpro/websites/puravida.dev/includes/common.inc:7646 0.1031 4497500 8. NodeController->attachLoad() /home/drupalpro/websites/puravida.dev/includes/entity.inc:204 0.1041 4501940 9. DrupalDefaultEntityController->attachLoad() /home/drupalpro/websites/puravida.dev/modules/node/node.module:3953 0.1041 4502284 10. field_attach_load() /home/drupalpro/websites/puravida.dev/includes/entity.inc:320 0.1144 4794672 11. _field_invoke_multiple() /home/drupalpro/websites/puravida.dev/modules/field/field.attach.inc:709 0.1149 4802808 12. text_field_load() /home/drupalpro/websites/puravida.dev/modules/field/field.attach.inc:345 0.1155 4806976 13. _text_sanitize() /home/drupalpro/websites/puravida.dev/modules/field/modules/text/text.module:159 0.1155 4806976 14. check_markup() /home/drupalpro/websites/puravida.dev/modules/field/modules/text/text.module:319 0.1218 4858664 15. media_filter() /home/drupalpro/websites/puravida.dev/modules/filter/filter.module:761 0.1218 4861016 16. preg_replace_callback() /home/drupalpro/websites/puravida.dev/sites/all/modules/media/includes/media.filter.inc:29 0.1219 4867784 17. media_token_to_markup() /home/drupalpro/websites/puravida.dev/sites/all/modules/media/includes/media.filter.inc:0 0.2064 5806356 18. drupal_render() /home/drupalpro/websites/puravida.dev/sites/all/modules/media/includes/media.filter.inc:136 0.2064 5807624 19. theme() /home/drupalpro/websites/puravida.dev/includes/common.inc:5772 0.3845 6223856 20. theme_image_style() /home/drupalpro/websites/puravida.dev/includes/theme.inc:1142 0.3870 6317752 21. theme() /home/drupalpro/websites/puravida.dev/modules/image/image.module:1267 0.3871 6319324 22. adaptivetheme_preprocess_image() /home/drupalpro/websites/puravida.dev/includes/theme.inc:1106
The adaptivetheme_preprocess_image function was not present in the dev version of the theme so it was working fine. Also when I remove the function from the preprocess.inc file the site works as it should. Looks like someone else had a similar problem here http://drupal.org/node/1710516
Together with the theme I also updated several modules. So I might have broken something somewhere. Also I think it is worth mentioning that the error occured on a pet project of mine with which I have been tinkering since the early days of AT 3.x. I have updated the theme on several occasions. I am completely aware that things change during development and that might be the reason behind the error. I have no problems starting from scratch.
*EDIT*
The culprit here might be the media module as disabling it made the error disappear and site functional again.
Comment | File | Size | Author |
---|---|---|---|
#8 | adaptivetheme-Fatal_error_after_updating-1711746-6324258.patch | 995 bytes | peezy |
#4 | adaptivetheme-Fatal_error_after_updating-1711746-6316480.patch | 804 bytes | peezy |
Comments
Comment #1
JimmyAx CreditAttribution: JimmyAx commentedI got this on a site too. The solution was to go to the theme settings page (for the current adaptive theme) and then submit the settings. You don't need to edit anything.
I think the reason for the bug is that the configuration format has changed, but the old is still in the database. It would be nice if this could be fixed automatically on update, or detect the incorrect configuration when rendering. Otherwise a big fat message on the project page would be nice to warn about this.
Comment #2
peezy CreditAttribution: peezy commentedI received the same error as @ranx (PHP Fatal error: [] operator not supported for strings in /sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc on line 853); however, neither of the solutions above works for me.
Any other ideas?
Comment #3
ranx CreditAttribution: ranx commented@JimmyAx Thanx for the suggestion. I actually tried removing the theme completely, clearing cache, putting the theme back, enabling it, saving settings. Now it worked . But only until I cleared the caches. Got the same error after that.
Comment #4
peezy CreditAttribution: peezy commentedA colleague and I dug a little deeper in the code and came up with this patch, which works for us. Maybe it will work for you, too.
Comment #5
Jeff Burnz CreditAttribution: Jeff Burnz commentedMan this drives me crazy why this occurs, we do this stuff everywhere in Drupal but sometimes it throws this infernal error. The patch looks fine.
Comment #6
peezy CreditAttribution: peezy commentedThanks for looking at it, Jeff. I just realized I forgot to set the status to "Needs Review" earlier.
Comment #7
ranx CreditAttribution: ranx commentedAfter applying the patch, saving settings and clearing cache I can see the site but get the following notices three times:
Comment #8
peezy CreditAttribution: peezy commented@ranx: Thanks for testing. Please try this one, where I initialize the class variable.
Comment #9
JimmyAx CreditAttribution: JimmyAx commentedI just got this bug again after updating the ctools module to 1.1. I did not do anything else, so I'm bumping this to critical. Patch in #8 works perfect. Setting this to RTBC as #8 provides a hotfix unless someone minds.
I modified the patch a little on my site to do a
var_dump($vars['attributes']['class']);
if the value is not an array. Results?string(11) "media-image"
. So this is probably not a bug in adaptivetheme, but rather contrib modules. Can anybody confirm this?Comment #10
mermentau CreditAttribution: mermentau commentedI came to the same error by a different route. I upgraded from 7.x-2.3 and had AT working fine using only the AT Admin. After getting the ctools 7.x-1.1 update today I had 2 sites that would give the error when I clicked either the Content or Dashboard link in admin.
Happy to report the #8 patch worked for both sites!
Edit: After reading again one of the earlier posts here I cleared the cache and the problem returned
Comment #11
JimmyAx CreditAttribution: JimmyAx commentedFor everybody having the media module enabled and experiencing this bug the patch in #1722146: Media filter is using string instead of array for the class attribute will solve this. If you don't have the media module enabled then we have one more bug to hunt down.
Comment #12
ranx CreditAttribution: ranx commented#8 worked for me. No more errors. Thank you!
Comment #13
Jeff Burnz CreditAttribution: Jeff Burnz commentedI'll test and probably commit this to DEV, but will hold off releasing a new version until we see some feedback on the media module bug.
Comment #14
mermentau CreditAttribution: mermentau commentedI can report 2 sites working fine now with the patch and the latest ctools 7.x-1.1 and media 7.x-2.0-unstable6 versions. Just using ATAdmin at this time on each site.
Comment #15
Kristen PolRTBC++
After applying patch #8, all is well. Please commit :)
Comment #16
Jeff Burnz CreditAttribution: Jeff Burnz commentedThe patch with a small mod (from #8) is now committed, I want to run through a few other issues before cutting a new release, for now pull from GIT or wait for the dev archive to update.
Thanks peezy and all who tested, great work.
Comment #17
Jeff Burnz CreditAttribution: Jeff Burnz commentedOp's, fixed!
Comment #18
Jeff Burnz CreditAttribution: Jeff Burnz commentedAnyone using User Badges and getting this issue?
Comment #19
JimmyAx CreditAttribution: JimmyAx commentedI do not have that module myself, but a quick check of the source shows that they probably have the same issue as Media. Check line 675, 692 and 698.
http://drupalcode.org/project/user_badges.git/blob/refs/heads/7.x-1.x:/u...
Comment #20
Jeff Burnz CreditAttribution: Jeff Burnz commented#1748394: Class attributes should be an array, not a string opened for user badges module.
Comment #21
Jeff Burnz CreditAttribution: Jeff Burnz commentedFuck it, I am marking all these issues regarding class attributes as strings as feature requests - the theme is doing it right, its the module/s that are wrong the onus is on THEM to fix it - module developers need to get their shit together on this issue - I have found 3 other modules just today that cause this issue - all of them are broken and need to fix it.
Comment #23
clemens.tolboomYou can scan your own site modules with
Note this error is not a bug of Adaptive Theme.
Comment #23.0
clemens.tolboomUpdated issue summary.