Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I note there are frequent PHP5 errors, which are usually resolved by inserting
(array)
somewhere, often in foreach() statement. This case:
Invalid argument supplied for foreach() in C:\workspace\mysite\modules\cck\content.module on line 624
In this case
foreach ($array as $key1 => $value1) {
is fixed if you change it to
foreach ((array)$array as $key1 => $value1) {
I used to get a fair number of these, and I found that if I develop in PHP5 environment I have fewer issues w/ PHP version-related bugs popping up. That's just me.
Thanks
Comment | File | Size | Author |
---|---|---|---|
#5 | cck_php5_changes.patch | 2.54 KB | dado |
Comments
Comment #1
dado CreditAttribution: dado commentedHere's some more
Warning: Invalid argument supplied for foreach() in C:\workspace\mysite\modules\cck\nodereference.module on line 89
Warning: Invalid argument supplied for foreach() in C:\workspace\mysite\modules\cck\content.module on line 625
in each case, add
(array)
to fix.
Comment #2
dado CreditAttribution: dado commentedand another
Warning: array_pop() [function.array-pop]: The argument should be an array in C:\workspace\mysite\modules\cck\nodereference.module on line 175
Comment #3
dado CreditAttribution: dado commentedThe latter one I had to change this
to this
Comment #4
dado CreditAttribution: dado commentedOops disregard last post. Maybe change to something like this
Comment #5
dado CreditAttribution: dado commentedin case you should want it, i attach a patch which encompasses the above changes
Comment #6
webchickComment #7
JonBob CreditAttribution: JonBob commentedPatched in a slightly different manner.
Comment #8
(not verified) CreditAttribution: commented