Sort by date bug on dynamic albums ?


I have checked all my parameters in the admin pages but i have not found anything wrong.
- Options -> Search -> No options found for sorting.
- Options -> Pictures -> Sort by date.
- Album (maitres_du_vent) -> Sort sub-albums by title.
- Album (maitres_du_vent) -> Sort pictures by date.
- Any sub-albums (all are dynamic) of maitres_du_vent -> Sort sub-albums (don't have any) and sort pictures like parent album.

Sort don't work or i miss an option somewhere. You can check for test at:

Photo order is 2010-03-20, 2012-04-09, 2012-06-10, 2012-06-16, 2011-06-18, 2010-07-14, 2012-08-04, 2012-08-05, 2011-08-07, 2011-09-10

Sort function don't use year ? It's really strange a sort function with only month and day...

You can check the problem in any sub-albums of 'Maitres du vent'. Date and time are written under photo.

Also test to force date sort in a sub-album but that don't change anything.

I made a test with the standard theme. Always the same problem.

Does someone have a solution ?

Thanks in advance.



  • Sorry, I cannot reproduce this on my installation. I modified the default theme to print the date/time under the thumbnails and set both ascending and descending date sorts for the album images. Both worked as expected.

    My only thought is that maybe there is a search caching involved. Set the cache expiry to 0 on the search options tab and see if that makes any difference.
  • Thank you for your reply.

    I set the search cache expiry to 0.
    I have purge browser cache, history and other temporary items.
    With Ftp i have delete the entire sub-folders ./cache/maitres_du_vent.
    To complete the clean process in the ZenPhoto admin i have launch the process for updating and cleaning the database.

    In the admin section of a dynamic album i have purge the cache image of the album.

    The problem is always here. :-(

    I made the test with the last version of Firefox and Safari.
    I really don't understand. I always update to the last version of ZenPhoto.
  • The image cache will not matter here. You can look into your database and see if the dates for the images look correct. The sort function sorts on that entire field.
  • I not found any wrong date in the database.

    Can the problem come from the database type (utf-8, latin) ?
    I made an export of my db. You can download it here if you want:

    Thank you again for your help.
  • Dates do not have any characters that encoded differently between utf-8 and latin. But the DB should be in UTF-8.

    When you tried a standard theme, did you use `default`? That is the simplest theme and would be the best test.
  • Hello Chief,

    Yes, i made test with the default theme.
    My theme is also build from default.
    I don't use any 3rd party extensions.

    If that can help, database table are MyISAM - utf8_unicode_ci
    The last line of PhpMyAdmin give me 16 tables MyISAM - latin1_swedish_ci

    I confirm that is only a problem with the search option.
    I made a copy of some photos from different years to a same folder. Take a look at the link below to see them in the right order:

    Now make a search with the word zen. You should have the same pictures but in the wrong order.

    If that can help, here my search.php:

    <?php include ('header.php'); ?>
    <div id="contenu">

    $total = getNumImages() + getNumAlbums();
    if (!$total) { $_zp_current_search->clearSearchWords(); }

    <h2><?php echo "<h2>".gettext("Search")."</h2>"; ?></h2>

    if (($total = getNumImages() + getNumAlbums()) > 0)
    if (isset($_REQUEST['date'])){ $searchwords = getSearchDate(); } else { $searchwords = getSearchWords(); }
    echo '<h3><p>'.sprintf(gettext('Total matches for %1$s: %2$u'), $searchwords, $total).'</p></h3>';
    $c = 0;

    <?php while (next_album()): $c++;?>
    <div class="album">
    <div class="albumthumb">
    " title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printCustomAlbumThumbImage(getAnnotatedAlbumTitle(),NULL,270,130,270,130); ?>
    <div class="albumdesc">
    <h3>" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumTitle(); ?></h3>
    <?php endwhile; ?>
    <br style="clear: both" />

    <?php while (next_image()): $c++;?>
    <div class="imagealbum">
    <div class="imagealbumthumb">
    "><?php printImageThumb(getAnnotatedImageTitle()); ?>
    <?php endwhile; ?>

    <?php if ($c == 0) { echo "<h3><p>".gettext("Sorry, no image matches found. Try refining your search.")."</p></h3>"; } ?>

    <br style="clear: both" />
    <?php if (function_exists('printSlideShowLink')) printSlideShowLink(gettext('View Slideshow')); ?>

    <?php printPageListWithNav("« ".gettext("prev"), gettext("next")." »"); ?>

    </div><!-- contenu -->
    <?php include ('footer.php'); ?>

  • can you try an experiment for us?

    Remove any use of `getNumAlbums()` from the search page and see if the problem is still there.
  • I made the change in my search.php. Replace this 2 lines:
    $total = getNumImages() + getNumAlbums();
    if (($total = getNumImages() + getNumAlbums()) > 0)

    With this one:
    $total = getNumImages();
    if (($total = getNumImages()) > 0)

    After that for better test i made a purge of the browser cache.
    But that don't change anything. Always bad sort with search... :-(
  • I think this will take some effort to find and fix. I suggest you create a bugtracker ticket so we can take it off line. In the meantime I will think about how we can debug the issue. Probably it will involve you trying out various debug versions of the search script.
  • Hi
    what release of zenphoto arête yougoslave using ?
    Do you cave the problem with standard albums too?
    As far I remember there was a sort issue on solder release if you choose a specific représentant thumbnail
  • vincent3569 thank you for your suggest but it's only a search sort by date bug.

    Of course sbillard, i accept to make all the necessary test to solve that bug.
    I have open a ticket for this bug: Ticket #2224

    Thank you for all.
  • ok I understand
    but there was a similar issue in the past on standard albums :
    see here :

    of course, I don't know if it's a linked issue, but maybe you should tell us what is your thumbnail configuration on your dynamic album.
Sign In or Register to comment.