I enabled this module with aqcuia drupal distribution with some standard modules enabled and got following error

* warning: in_array() [function.in-array]: Wrong datatype for second argument in /media/disk/workspace/prive_karolina/www/sites/all/modules/contrib/skinr/skinr.module on line 145.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /media/disk/workspace/prive_karolina/www/sites/all/modules/contrib/skinr/skinr.module on line 145.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /media/disk/workspace/prive_karolina/www/sites/all/modules/contrib/skinr/skinr.module on line 145.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /media/disk/workspace/prive_karolina/www/sites/all/modules/contrib/skinr/skinr.module on line 145.

I'm using the fusion theme and created a subtheme. What more information can I supply you?

CommentFileSizeAuthor
#15 skinr_in_array_error.patch766 bytessociotech

Comments

bpinkney’s picture

I'm running PHP 5.3.1 and I get a similar error using Acquia Prosper:

* warning: in_array() expects parameter 2 to be array, string given in /var/www/vhosts/example.com/httpdocs/modules/skinr/skinr.module on line 145.
* warning: in_array() expects parameter 2 to be array, string given in /var/www/vhosts/example.com/httpdocs/modules/skinr/skinr.module on line 145.
* warning: in_array() expects parameter 2 to be array, string given in /var/www/vhosts/example.com/httpdocs/modules/skinr/skinr.module on line 145.
* warning: in_array() expects parameter 2 to be array, string given in /var/www/vhosts/example.com/httpdocs/modules/skinr/skinr.module on line 145.

jupiterchild’s picture

I can confirm this.

Today I updated Aqcuia Prosper to 6.x-1.0-beta3 and Fusion to 6.x-1.0-beta3. I ran update.php and flushed ALL caches and now receive this message when making changes to the Aqcuia Prosper theme:

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/****/public_html/*****/store/sites/all/modules/skinr/skinr.module on line 145.

In this instance the issue occurs in the configuration form for Aqcuia Prosper >> Layout when switching between:

16 column fixed grid [960px] - Theme Default
and
16 column fluid grid

jupiterchild’s picture

@ #2
Should have stated I am using:

Drupal 6.14
PHP 5.2.9
MySQL 5.1.30
Skinr 6.x-1.x-dev (2009-Nov-27)

TJM’s picture

I'm having the same problem.

..../www/sites/all/modules/contrib/skinr/skinr.module on line 145.
Drupal 6.14
PHP 5.2.9
MySQL 5.1.33
Panels 6.x-3.1
Skinr 6.x-1.1
Adaptivetheme 6.x-2.0-beta2

TJM

mattandersondc’s picture

I'm also seeing this error and I haven't switched from 16 column fixed grid [960px] - Theme Default
and
16 column fluid grid.

I have simply enabled the theme with the default and am seeing this same error.

jacine’s picture

Don't use the dev version. You should all be using 6.x-1.1. Then make sure you are using the latest versions of Fusion and Acquia Prosper. If once you do that you are still having a problem let me know.

The development snapshot for D6 is now gone from the project page.

TJM’s picture

I'm using Skinr 6.x-1.1 module and I still get the error ...sites/all/modules/contrib/skinr/skinr.module on line 145..

Drupal 6.14
PHP 5.2.9
MySQL 5.1.33
Panels 6.x-3.1
Skinr 6.x-1.1
Adaptivetheme 6.x-2.0-beta2

TJM

iameric’s picture

Same problem here.

Drupal 6.14
MySQL 5.0.81
PHP 5.2.11
Skinr 6.x-1.1

akael’s picture

Same problem here, latest versions of Fusion and Acquia Prosper.

portait’s picture

I am also getting this error message.

ingopingo’s picture

So am I.

Drupal 6.14
PHP 5.2.8-0
MySQL 5.1.30

mangaan’s picture

Yep confirmed

Turnkey linux

Drupal 6.14
PHP 5.2.4
mysql 5.0.51a

* warning: in_array() [function.in-array]: Wrong datatype for second argument in /etc/drupal/6/sites/all/modules/skinr/skinr.module on line 145.
* warning: in_array() [function.in-array]: Wrong datatype for second argument in /etc/drupal/6/sites/all/modules/skinr/skinr.module on line 145.

all modules are up to date as today

yha’s picture

same problem, Fusion, Prosper

formalist’s picture

Same here. I get 4 lines like:

# warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Drupal\cms\sites\all\modules\skinr\skinr.module on line 145.

Nevertheless, the module seems to works fine for me. Does it work fine also for all of you? Is someone experiencing problems, instead?

Thanks.

sociotech’s picture

StatusFileSize
new766 bytes

Everyone, Jacine,

This one is our (TNT's) fault. In the latest version of Acquia Prosper, we used an "undocumented feature" of Skinr to disable an inherited skin in a sub-theme.

Basically, we wanted to inherit all the skins from Fusion Core except for the 12 column grid widths. We were trying to keep the interface of the sub-theme as non-confusing as possible after introducing the ability to use alternate grids (e.g., 12 column instead of 16 column) in the Fusion Core base theme. Obviously, having both 16 and 12 column grid widths in the block admin interface when your theme only uses a 16 column grid would cause some confusion.

The undocumented feature is that if you redefine the skin in the sub-theme's .info file but leave it blank, then it doesn't show up in the Skinr interface. The offending code is in lines 55-56 of acquia_prosper.info:

; Disable 12 column grid block widths inherited from fusion_core
skinr[grid12-width] =

This technique works great and it's a crucial ability for us so we can pack as much functionality into the base theme, but not overwhelm the interface of a sub-theme with unused skins.

Ideally, we'd like to be able to keep this valuable feature, and I've attached a small patch (against 6.x-1.1) that eliminates the warning messages while keeping the feature intact. The alternatives for us are not great: either duplicating skins on a sub-theme-by-sub-theme basis (a maintenance/QA nightmare) or displaying unused skins in the interface (a usability nightmare).

If this isn't the approach you'd like to take or you have a better alternative for us, let me know.

Not sure why AdaptiveThemes would be throwing this error, unless they're using this technique as well.

Thanks!

mangaan’s picture

OK

this patch worked for me, keep up this wonderful project ;-))

Thanks !!

_cc_’s picture

Yes, patch worked for me too (well, I editted the file by hand, it's only a one line change).

jcmarco’s picture

Status: Active » Reviewed & tested by the community

Works fine.
Thank you.

akael’s picture

Work here, thanks!

ingopingo’s picture

Yep! Seems to work. Thx

jmbarlow’s picture

The patch eliminates the error message for me (skinr 6.x-1.1 and Fusion 6.x-1.0-beta3)

dcarr’s picture

Worked for me! Thanks!

hhkont’s picture

Help a newbie - how do you apply the patch?

jcmarco’s picture

hhkont’s picture

Thanks. Worked great.

2faroffroad’s picture

Worked.

robin.prieschl’s picture

Had the same problem with Beta 3.

Applied the patch above.

And now works fine. No Error.

willvincent’s picture

This patch clears things up for me as well.

pepemty’s picture

I don't have SSH access :-(
Will this patch be committed?

Warm regards from sunny México!
:-)
Pepe

Edit:
Did a little reading, and (I know I really shouldn't) dared to do it "manually". Located the line marked with a (-) and changed it with the (+) one.
Everything seem OK now...

moonray’s picture

Assigned: Unassigned » moonray
Status: Reviewed & tested by the community » Fixed

Seems useful. Committed to CVS.

MacRonin’s picture

Just read thru the issue, and now see why the msg went away when I switched to "Fusion Core" or Prosper. I just downloaded the themes in the last 24 hours so I'm probably have the patch already in place. ( had seen the msg all over a while back when I first put in my sandbox)

But in my current dev site, I sometimes also go back to the basics(Garland), just to see how something starts out before my changes. In that config (skinr still active) I still get the error msg. I'm guessing while its not pretty I can safely ignore in that situation?

BTW, Thanks for the great work, and enjoy the holiday.

hebhansen’s picture

Patch works thanks...

cbannerjee’s picture

Thanks for the patch - it is nice to see such a quick response to even the small issues!

And, of course, thanks for the absolutely brilliant theme!

attheshow’s picture

subscribing

plasticlax’s picture

patch worked

jamesoakley’s picture

Glad this to hear that this is patched. How do we obtain the patched version? - 6.x-1.x-dev hasn't been updated since June, so that can't be it.

Jeff Burnz’s picture

Note: even if you are not using Fusion Starter if you have it enabled you will get this error - this is because Skinr builds the form elements for each enabled theme - so for those of you getting this error when using Adaptivetheme, Garland etc and you are not using Fusion Starter either disable Fusion Starter or apply the patch.

I spent quite some time trying the recreate this in Adaptivetheme without any joy, then it struck me to install and enable Fusion Starter.

The patch is a good fix and a sensible improvement; hoping to see a new release of Skinr soon with this as it is not clear if DEV is stable or if we should go on patching for the time being.

@#36 at time of writing DEV was last updated on Dec 18th, June 11th was the release date.

druplicate’s picture

When will this get fixed in Acquia Marina 3?

There's no dev version.

moonray’s picture

Dev is stable and useable. Not all themes might be updated to work with it, though.
Since the last release there were no major changes in API for dev, though, so you should theoretically be good.

Themes written for dev might not necessarily work with the last release, though.

cgrant3d’s picture

subscribe

roball’s picture

Confirmed that Skinr 6.x-1.x-dev (2009-Dec-29) works fine with Fusion 6.x-1.0-beta3, while the latest official stable release (6.x-1.1) issues the mentioned error whenever a block will be edited.

sociotech’s picture

moonray,

I've been seeing a few instances in which our users are getting the following errors:

# warning: Invalid argument supplied for foreach() in /home/username/public_html/sites/all/modules/skinr/skinr.module on line 297.
# warning: Invalid argument supplied for foreach() in /home/username/public_html/sites/all/modules/skinr/skinr.module on line 309.

From what I've been able to tell, it's likely caused by using a disabling function (e.g., "skinr[grid16-width] =") on a setting that has been previously used. The disabling apparently overwrites settings saved into the Skinr entry for the theme in the Variables table with empty values. These empty values then get read back in as semicolons (";") and cause the invalid argument warnings above.

I was able to eliminate the errors by manually deleting the entry in the Variables table. It doesn't look like Skinr has an uninstall procedure, but that would be another way to clear the entry.

Of course, it would be ideal if there were a way to avoid creating or reading empty entries.

I'm continuing to look into this.

Thanks.

moonray’s picture

The dev version already doesn't store empty values, but you'll have to resubmit each setting for it to take effect.
Another way right now is to export settings, edit them (if needed), then import them again.

An uninstall for Skinr is a good idea (I can't believe I forgot about it).

kevancummins’s picture

"Confirmed that Skinr 6.x-1.x-dev (2009-Dec-29) works fine"

I can't seem to find the 6.x-1.x-dev (2009-Dec-29) download - can anyone send the link

kevancummins’s picture

I couldn't find the latest dev version for Dec 29 - so I applied the patch instead and it works great - thanks for the speedy fix.

matiasc’s picture

Worked for me! Thanks!

vrajak@gmail.com’s picture

Have the same issue as above with the wrong array. I have the patch, but do not know how to apply it. Any help would be appreciated!

ChrisBryant’s picture

@Vraja, If you read through the issue above you will see someone asked the same question (comment #24) and it was answered in comment #25 with a link to this page for applying patches:

http://drupal.org/node/60108

Also, please note that you shouldn't need to patch the module now though, rather read comment #30 where the patch is committed and #46 (http://drupal.org/node/648816#comment-2455508) which has a direct link to the dev version of skinr which already includes the patch.

Just download that and you should be good to go.

http://drupal.org/node/488352/release => http://ftp.drupal.org/files/projects/skinr-6.x-1.x-dev.tar.gz

vrajak@gmail.com’s picture

I did read through, but it wasn't clear to me. I'm pretty new at running a live site. Thanks so much for clarifying!

Status: Fixed » Closed (fixed)

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