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.

Comments

Priority:Normal» Major

I 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.

I 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?

@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.

A 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.

Man 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.

Status:Active» Needs review

Thanks for looking at it, Jeff. I just realized I forgot to set the status to "Needs Review" earlier.

After applying the patch, saving settings and clearing cache I can see the site but get the following notices three times:

Notice: Undefined index: class in adaptivetheme_preprocess_image() (line 853 of /home/drupalpro/websites/puravida.dev/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc).
Notice: Undefined index: class in adaptivetheme_preprocess_image() (line 858 of /home/drupalpro/websites/puravida.dev/sites/all/themes/adaptivetheme/at_core/inc/preprocess.inc).

@ranx: Thanks for testing. Please try this one, where I initialize the class variable.

Priority:Major» Critical
Status:Needs review» Reviewed & tested by the community

I 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?

I 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

For 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.

#8 worked for me. No more errors. Thank you!

I'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.

I 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.

RTBC++

After applying patch #8, all is well. Please commit :)

The 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.

Status:Reviewed & tested by the community» Fixed

Op's, fixed!

Anyone using User Badges and getting this issue?

I 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...

Category:bug» feature
Priority:Critical» Normal

Fuck 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.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

You can scan your own site modules with

grep -r "\['attributes'\]\['class'\]" sites/*

Note this error is not a bug of Adaptive Theme.

Issue summary:View changes

Updated issue summary.