After applying patch at http://cgit.drupalcode.org/redhen/commit/modules/redhen_relation?id=825b...
We get an error on trying to implode $relation_types which is not an array (because it's NULL in our case).
I think the following explains what's happening (again, I think).
function redhen_relation_relations($entity, $relation_types = NULL, $active = FALSE)
$relation_types is default NULL
The patch checks if $relation_types exists and is not an array, but NULL bypasses this check and it's never set to an array
if ($relation_types && !is_array($relation_types)) {
$relation_types = array($relation_types);
}Then we try to implode $relation_types which is possibly NULL
$related_entities = &drupal_static(__FUNCTION__ . $entity->entityType() . $entity->internalIdentifier() . implode('-', $relation_types) . $active, array());
Propose to set $relation_types = array() in function definition
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 2662294.patch | 544 bytes | nikunjkotecha |
Comments
Comment #2
darkodev commentedComment #3
darkodev commentedComment #4
nikunjkotecha+1
agree with the problem and solution both
Comment #5
nikunjkotechaadding patch
Comment #6
nikunjkotechaComment #7
MichaelSt commentedI'm having the same issues... Is this patch from #6 working for anyone/everyone?
Thanks!
Comment #8
nikunjkotechaIts working for me MichaelSt, but it needs to be applied after the patch from http://cgit.drupalcode.org/redhen/commit/modules/redhen_relation?id=825b...
Comment #9
MichaelSt commented#6 applied after http://cgit.drupalcode.org/redhen/commit/modules/redhen_relation?id=825b... also seems to be working for me - trying it on test site and no error messages.
Thanks nikunjkotecha.
Comment #10
socialnicheguru commentedComment #11
kristiaanvandeneyndeWorks fine, code change is simple and self-explanatory.
Comment #12
MichaelSt commentedFYI, I needed to add this patch (without the parent patch) to keep this error from happening after upgrading to 7.x-1.12.
Comment #13
johnhanley commentedConfirmed. This patch solves the runtime error shown when viewing an organization's connections page (exp. redhen/org/1/connections) with Redhen 7.x-1.12:
Comment #15
gcbThanks for the patch @nikunjkotecha!