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.
First of all let me thank you for this great module and for the imagefield support.
The problem occurs if you put a empty imagefield into a fieldgroup.
Expected behaviour:
Nothing gets displayed because the imagefield is empty.
Erroneous behaviour:
An "empty " fieldgroup is display.
Reason:
The galleria template (galleria.tpl.php) outputs
<div id="galleria-content">
<div id="main-image"></div>
<div class="item-list"></div>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
//Hide images while Galleria is loading
$('ul.gallery img').css('display', 'none');
//--><!]]>
</script>
</div>
even if $image_count is 0.
Solution:
Wrap the HTML into
if ($image_count != 0) :
....
endif;
So that nothing is returned, not even one " " (took me an hour to find that...).
Sincerely Markus
Comments
Comment #1
Mark Theunissen CreditAttribution: Mark Theunissen commentedThanks for the clear bug report, committed!
Comment #3
worldwidemv CreditAttribution: worldwidemv commentedThank you for the quick fix.
Unfortunately the problem still exists.
Line 9 and line 29 in galleria.tpl.php are newlines.
Line 9 seams to be the problem because the template file returns something like "\n".
Maybe CCK fieldgroup should be not this strict and ignore newline and space (with trim perhaps).
I am not familiar with the Drupal coding standards and therefore can't decide if this is still a galleria issue.
Sincerely Markus