Sort by ID Problem

I would like to sort images by ID (Descending) so that the newest additions show up on top. I have changed the following admin options, and images are not showing up in the correct order on the front-end gallery or back-end admin area.

A. Admin > Options > Image > Sort images by: ID (Descending)
B. Admin > Albums > Album > Sort images by: ID (Descending)
C. Admin > Albums > Images > Display images by: ID (Descending)

Not only are images not displaying correctly by ID, there they won't change display order at all, regardless of sort option selected (date, filemtime, name, etc.). I have cleared browser cache, history, cookies, etc. I have refreshed the database, purged cache, etc. phpMyAdmin displays all information in zp_images table correctly.

Any idea what is causing this problem?

Thanks.

Comments

  • acrylian Administrator, Developer
    A. has only effect if you set the sort order of an album to "gallery album sort order". Although it seems I indeed can reproduce that even setting that option gallery wide has no effect at all.

    Btw, C. is only a setting for the backend display, no sort order for the front end.

    CORRECTION: My browser cache was playing tricks on me this time. It does work as expected for me.
  • Hmmm, still misbehaving on both the front and back. I cleared my browser cache again and tried it in both Firefox and Safari. Same problem.

    On the back end, I would expect the image list to resort itself when I select a new sort order. The page reloads but the images do not resort.

    Likewise on the front end where I'm not able to change the sort order with any of the options (date, name, ID, etc.) despite resetting image order to default to "gallery default image sort order".

    BTW, I'm using version 1.2.6 [4335].
  • It should resort the back end as you say. Did you get a browser referesh after changing the sort?
  • The page definitely reloads but the sort order does not change. Changes to image name, date, filename, etc. are all retained on save.
  • Sorry, I really have no idea. The order should be comming from the MySQL query order by clause. All works for me.
  • Oh, man. I backed up and deleted my database and trashed my ZP install (keeping the customized theme, album, zp-data, etc.). I downloaded and reinstalled ZP 1.2.6 and restored the database from the back up and have the exact same problem.
  • I'll be a good forum citizen and follow up with my discovery / solution. Apparently, I've been using zp-config.php from an previous install of ZenPhoto and the permissions were set to 0755 rather than 0777.

    The line in zp-config.php is:
    `if (!defined('CHMOD_VALUE')) { define('CHMOD_VALUE', 0777); }`

    This correction resolved my gallery sort problems.
  • I wanted to revive this thread because I'm having almost exactly the same problem with a fresh install (v1.2.6).

    I have only created one album so far and uploaded some hundred or so images to it via FTP. They showed up correctly in the album and the date field for each record in the image table is populated with the correct values but I cannot change the sort order to Date or anything else for that matter.

    No matter what I set the sort order to, the images always display in a fixed, apparently random order. I've tried setting the order in Admin > Options > Image > Sort images by and in Admin > Albums > Album-Name > Sort images by and I've also tried using the drag and drop manual sort and that also silently fails (appears to work but album sort order is unchanged).

    I've looked at the albums table in phpMyAdmin and the fields sort_type (empty), subalbum_sort_type (empty), sort_order (null), image_sortdirection (0) and album_sortdirection (0) are not being updated by the admin control panel (current values in parenthesis). No matter what I do, their values don't update. The MySQL user has full control over the ZP database.

    I'm tearing my hair out over this one and just can't seem to work it out so any advice would be appreciated, thanks.

    [edit to add] I should probably point out that this happens with the default theme and all others...
  • Are you having problems saving other options? If these fields are empty then the "save" did not work. You could try setting the options directly in the database.
  • I've fixed it now, thanks. I don't know what went wrong when I created the gallery first time but I made a new gallery and ran the upload again and it was fine... Don't know what the cause was though...
  • I am having a similar problem. I have my albums all sorted by filename, and the subalbums all use the parent album sort order. Up until now, all of my albums sorted fine, but one of them is now sorting incorrectly and I can't change the sort order on any of my albums. Because everything had sorted properly before, I can't say whether I have ever been able to change the sort order for an individual album. Clearing my cache and refreshing don't do anything either. I am able to save other options, such as renaming an album and setting an image to be the thumbnail.

    I looked in my phpMyAdmin, and all of my sort tables are the same as JeremyK's. I have also tried refreshing the database and metadata, but this doesn't do anything. Any suggestions?
  • Same problem. It's a showstopper for me.
  • nvmd, in Admin>Edit>Album, I had sort order set to Manual. I guess i wanted to try the drag and drop feature at some point. The interesting thing is that i never dragged and dropped the images around, and the sort order went all random. Hope I can reproduce this as it's something i wanted to do anyway.
Sign In or Register to comment.