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.
Full Error:
warning: Invalid argument supplied for foreach() in .../wwwroot/sites/all/modules/cnr/corresponding_node_references.module on line 53.
The line:
foreach ($data['referenceable_types'] as $reference) {
I was able to temporarily fix this by wrapping the foreach loop in an if statement
if (is_array($data['referenceable_types'])) {
foreach ($data['referenceable_types'] as $reference) {
....
}
}
Cheers.
Comments
Comment #1
domidc CreditAttribution: domidc commentedOk thanks for the info and fix. After refactoring the module I forgot to look at the screen when no referencable type where present.
Comment #2
domidc CreditAttribution: domidc commentedComment #3
czigor CreditAttribution: czigor commentedI could not really reproduce this error, as $data['referenceable_types'] is never empty. Could you provide details how you did it?
Comment #4
domidc CreditAttribution: domidc commented