Notice: Array to string conversion in at_get_plugins() (line 38 of C:\wamp\www\active-local-projects\siv\sites\all\themes\adaptivetheme\at_core\inc\plugins.inc).

There's 4 of them being output. I've got atpe as the theme layout.

drupal 7.17
php 5.4.3

Comments

Jeff Burnz’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Need more info, cannot reproduce with this information.

kingfisher64’s picture

Status: Postponed (maintainer needs more info) » Active

What further information do you need Jeff? I'll try my best to disclose it once I know what you're after.

local setup:

drupal 7.17
apache 2.4.2
php 5.4.3
mysql 5.5.24

http://drupal.org/project/panels 7.x-3.3 (2012-Aug-18) - #6 patch from http://drupal.org/node/1828684 applied
http://drupal.org/project/ctools - 7.x-1.2 (2012-Aug-18)
http://drupal.org/project/panels everywhere 7.x-1.0-rc1 (2012-Jul-11)
http://drupal.org/project/panelizer 7.x-3.x-dev (2012-Nov-17)

running latest themes
adaptivetheme 7.x-3.1 - 29th Aug
at_panelseverywhere 7.x-3.x-dev - 19th Sept

settings of atpe theme:

Enabled extensions (global setting)

Title styles
Image alignment and captions
Markup overrides

I suspect this is a php 5.4 issue. That's a stab in the dark but there's been a few issues with this version.

As usual many thanks :)

Jeff Burnz’s picture

OK, cool, great info which is what I need, can you give me all four notices so I can easily see where the issue exists for this (looks like a 5.4 issue).

kingfisher64’s picture

It's the same error messages repeated four times over

Notice: Array to string conversion in at_get_plugins() (line 38 of C:\wamp\www\active-local-projects\siv\sites\all\themes\adaptivetheme\at_core\inc\plugins.inc).

Jeff Burnz’s picture

Darn it, I was hoping for something more... this is hard error to track down :/

p0wer’s picture

Bump! I have exactly the same issue. Same theme - AT Panels Everywhere. I began getting errors and now my node template is not working :( I suspect that's something to do with custom panel layouts. What I did was duplicating a well working layout in a second directory, and then my node layout template stopped working. I could get the correctly themed panel display inside theme's node content area, but it won't replace my whole page template.

roheim’s picture

I had the same problem, but only when the cache was cleared. I have not gone deep into this, but for me it went away when I took away plugins[panels][layouts] = templates/panels from the info file. templates/panels did not have anything inside it.

Hope it helps.

lykyd’s picture

Same error for me : Notice: Array to string conversion in at_get_plugins() (line 38 of root\sites\all\themes\adaptivetheme\at_core\inc\plugins.inc) appears 4 times.

I didn't found any plugins[panels][layouts] = templates/panels in the info file of the subtheme or core theme. I'm using the at_panelseverywhere theme.

mrosenbaum’s picture

I had everything up and running fine, but started getting this error when I installed "@font-your-face". Hopefully, that helps narrow down the cause.

ey’s picture

I am also getting exactly the same notice. As I looked into the plugins.inc file on the line 40:

array_unique($plugins_list);

The notice is coming from the php function array_unique, which is according to php documentation not suitable for multidimansional arrays.

I have commented out this line and the notice is gone away.

Rustan’s picture

Same for me. Commenting it out removes the errors.

cconrad’s picture

I was getting the same notice with PHP 5.5. In my case debugging showed that commenting the line out wouldn't have changed anything, but I guess it is there for a reason - some special case maybe? So I changed it to read:

array_unique($plugins_list, SORT_REGULAR);

This way array_unique doesn't throw any notices. Whether it works as intended I don't know, Jeff can probably answer that. Also I guess there is a performance penalty when using the function this way.

Jeff Burnz’s picture

Priority: Minor » Normal

Adding the flag should be fine, really it should have been like this all the time imo, so good sleuthing and thanks for the debugging efforts and the fix. Cheers!

I'll update this issue when I have committed the fix, which will probably be reasonably soon.

Actually removing or commenting the array_unique would not be a huge issue for those of you who have done this, however you might run into issues if you start adding custom page layout or panels plugins in your sub theme (which you can do), we don't want the same plugin type definition being returned many times (which this function can do), we only need a list of all the types, not a list of every instance of each type.

cconrad’s picture

Thanks for fixing this Jeff!

You are probably aware of this, but the flag is only valid in PHP 5.2.9+ and D7 requires PHP 5.2.5+. Not that I hope anyone actually still runs that... but maybe check for it

Jeff Burnz’s picture

Hmmm, true, could add a check, I'll have to fully remind myself of why this is here, I know it had something to do with potentially including other types of plugins and how the plugin system works with regards to including plugins from sub themes, I am thinking maybe we can indeed remove it entirely, I will test for a bit and see what happens, would be preferable to remove code than writing a version check.