After adding a 3rd level of albums I noticed that the gallery view was not displaying sub albums. This is because node_gallery_hierarchy_get_subgalleries() is not correctly searching children.
Specifically, its trying to keep track of children in an array and does the following
$children += $gallery->children;
According to http://php.net/manual/en/language.operators.array.php, "+=" is not a valid operator for arrays. That page claims that "+" is a valid operator but I verified that
$children = $children + $gallery->children;
does not work with php 5.4.7. What does work is
$children = array_merge($children, $gallery->children);
Patch included.
Comment | File | Size | Author |
---|---|---|---|
node_gallery_hierarchy.inc_.patch | 549 bytes | bkat |
Comments
Comment #1
scroogie CreditAttribution: scroogie commentedInteresting. Just out of curiosity, why does + not work? Btw, I think if + is valid, += is valid as well. It's extended to the two seperate operators by the compiler.
Anyway, thanks for the patch! Commited.