Not sure if this is bug report for Imagefield Focus or Conditional Fields, but it appears the two don't work well together. Imagefield Focus works flawlessly normally, but when combined with Conditional Fields (which I used to give users a choice between adding an imagefield or an embedded YouTube clip), I get the following error message when saving a node:
warning: array_keys() [function.array-keys]: The first argument should be an array in [path]\imagefield_focus\imagefield_focus.module on line 239.warning: Invalid argument supplied for foreach() in [path]\imagefield_focus\imagefield_focus.module on line 240.
It's not a big deal - I just got rid of Conditional Fields and told users to choose one field or the other, but it'd be nice to use both modules together.
Otherwise, Imagefield Focus is fantastic - thanks for sharing your work.
Comments
Comment #1
anrikun commentedThanks for reporting this.
I'd like to reproduce your config with Conditional Fields (before you removed it).
Could you describe how you had configured your fields?
Had you added some checkbox so that user can choose between the 2 fields?
Comment #2
glennr commentedSure, I used Conditional Fields to create a widget that hid the imagefield and embedded media field until the user selected either "image" or "video" from from a select list. So, for the widget, I created a text field with a select list with two allowed values: "image" and "video". In the imagefield settings, in the conditional field section, I set the controlling field to "image". Then in the embedded video field settings, I set the controlling field to "video". And in the overall conditional field settings for the nodetype, I selected "hide untriggered fields".
Thanks for looking into it.
Comment #3
anrikun commented1 more question :-) What version of CF did you use?
Comment #4
glennr commentedI'm using CF 6.x-2.0-beta2, thanks.
Comment #5
Anonymous (not verified) commentedHello,
I have the same issue using Node Wizard (multi step creation form) https://drupal.org/project/node_wizard
No conditional fields on the image fields but on other fields. Maybe the issue is not related to Conditional Fields
Warning: array_keys() [function.array-keys]: The first argument should be an array in imagefield_focus.module on line 239.
Warning: Invalid argument supplied for foreach() in imagefield_focus.module on line 240.
Comment #6
anrikun commentedAll right, I need to have a look at this but I'm a bit busy at the moment.
Is this only a warning or does it break something?
Comment #7
Anonymous (not verified) commentedRegarding the node wizard module etc, it's not only a warning; Data are lost. Maybe it's related to the $form_state['storage'] that this module use. I don't know.
Anyway, I turned off the wizard and went back to a classic node creation form. Everything seems to be OK.
Comment #8
anrikun commentedOk thank you for the info. I'll let you know what I found.
Comment #9
anrikun commentedI have just tried ImageField Focus with Conditional Fields 6.x-2.0.
Everything seems to work flawlessly.
Maybe there was a bug in CF 6.x-2.0-beta2 that was fixed in version 6.x-2.0?
I'm marking this as "cannot reproduce". Feel free to reopen if needed.