Hello,

I got that message when I go to Edit Content Type :

warning: Invalid argument supplied for foreach() in ../sites/all/modules/i18n/i18nsync/i18nsync.module on line 74.

The message appears when I installed the CCK module. When I uninstall that module the bug desappear.

Config to reproduce :

drupal 6.3
CCK 6.x-2.0-rc4
Multilanguage 6.x-1.0-beta3

CommentFileSizeAuthor
#7 i18nsync.patch657 bytesmvc

Comments

kmetz’s picture

same here, same versions. happened after upgrading Multilanguage to 6.x-1.0-beta3 (from beta2)

tcconway’s picture

Same issue. Some further info:
Running d6.4, i18n v 1.0-b3 on a fresh install/fresh db.

I notice this when editing some of the content types though. There is no difference between my content types, yet the error shows up for "page", but not for "press_releases".

Alan Oliveira’s picture

add this line on line 74

 if ( ! isset($data['#options'])) { return; }
jotein’s picture

Thanks, it worked for me.

defconjuan’s picture

awesome, works for me too

tcconway’s picture

Brilliant! Thanks too.

mvc’s picture

Status: Active » Needs review
StatusFileSize
new657 bytes

Thanks, alan.oliveira. I made a small improvement and created a simple patch file. If this works for you, please respond and flag this patch as having been reviewed and tested by the community.

Alan Oliveira’s picture

well... how do I use this patch anyway?
juts copy and paste on line 74 ?

mvc’s picture

the handbook has information on how to apply a patch: http://drupal.org/node/60108

or you could do it by hand as you suggested. the lines which start with a + symbol are to be added between the existing lines (if there were any starting with a - symbol they would have to be removed). just find the corresponding section of the function i18nsync_form_alter() and add the three lines i wrote. but as the handbook says be sure to back up your files and your database first just in case!

once you've tried that, please come back and report your experiences. if there's a problem, i'll try to fix it. if everything works great, leave a positive review to help the module maintainers know that this patch should be considered for the next version.

gtakacs’s picture

Status: Needs review » Reviewed & tested by the community

Code snippet tested, it took care of the warning on the poll module.

skessler’s picture

Will this be included in the next version of the module or will we need edit this file each time? I have not needed to patch a module before.

Thanks,
Steve

mvc’s picture

@denverdataman: the maintainer(s) of this module will mark the status of this issue as "fixed" when this issue has been resolved, by including this patch, or by some other means. until then you'll need to apply this small patch. as always with drupal, if you want to help the maintainers evaluate whether this patch actually solves this problem, you could test it and leave a brief review here. the more people who test a patch, the sooner it's likely to be included in the next version.

jose reyero’s picture

Status: Reviewed & tested by the community » Fixed

Thanks

Anonymous’s picture

Status: Fixed » Closed (fixed)

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