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.

CommentFileSizeAuthor
node_gallery_hierarchy.inc_.patch549 bytesbkat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scroogie’s picture

Status: Active » Fixed

Interesting. 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.