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

Mark Theunissen’s picture

Status: Active » Fixed

Thanks for the clear bug report, committed!

Status: Fixed » Closed (fixed)

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

worldwidemv’s picture

Status: Closed (fixed) » Active

Thank 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