I've just upgraded CCK to the latest CVS and am now running the following versions:
drupal - 4.7.4
content.module - 1.56.2.29
content_admin.inc -1.12.2.19
content_views.inc - 1.1.2.7
fieldgroup.module - 1.1.2.2
number.module - 1.27.2.11
optionwidgets.module - 1.8.2.3
text.module - 1.32.2.14
When I go to admin/node/types/CONTENT-TYPE/fields, on some content types, I see the following error:
Warning: in_array(): Wrong datatype for second argument in /home/v/c/vcommunityaab/public_html/modules/cck/content_admin.inc on line 410
The error is often listed more than once and at first, I thought there was a correlation between the number of times that it appears and the number of groups in the content type, but that is not the case.
Also, it doesn't appear on every content type.
Any ideas?
Regards
Patrick
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedI think I see what might be causing this. Try changing line 410 to:
Comment #2
KarenS CreditAttribution: KarenS commentedAlso, what content types is this showing up on? Are they CCK types or something else?
Comment #3
KarenS CreditAttribution: KarenS commentedI think I know what's going on. I'll bet this is showing up only for content types that have no fields. Is that right?
Comment #4
Patrick Nelson CreditAttribution: Patrick Nelson commentedHi Karen,
They are all CCK content types, but all of the ones that it shows up on have fields.
Regards
Patrick
Comment #5
Patrick Nelson CreditAttribution: Patrick Nelson commentedAlso, your change above does seem to make the problem go away. Would that be a permanent fix, then?
Comment #6
KarenS CreditAttribution: KarenS commentedI'm still confused a bit because it doesn't look like this should happen, so I'm going to keep digging around. But, yes, that will be the fix.
Comment #7
yojoe CreditAttribution: yojoe commentedI just got the same error for one of my content types, after upgrading to cck-4.7.x-1.2
The addition of the (array) type hint to line 410 fixed it.
Comment #8
bluecobalt CreditAttribution: bluecobalt commentedI had the same error.
The fix from Karen took care of it.
Comment #9
yched CreditAttribution: yched commentedKaren : wouldn't adding
in content_admin_field_overview_form somewhere before
be a better fix than casting an array ?
Comment #10
jillelaine CreditAttribution: jillelaine commentedokay, i tested both KarenS and yched's fix for this issue: they both apparently work. Which one is the best? ;-)
here is what i put in the CCK content_admin.inc on the line above "foreach ($dummy_form as $key => $value) {"
so that it reads
if you tell me which one is the 'best' fix, i'll create a patch! thanks for the code, y'all.
Comment #11
yched CreditAttribution: yched commentedI went ahead and committed the fix in #9
fago proposed a similar (?) fix in http://drupal.org/node/108914, which was a duplicate
Comment #12
(not verified) CreditAttribution: commented