Dynamic Album Failure

This is weird...

Zenphoto 1.6.a and the matching ZPBootstrap

The site I'm managing has many dynamic albums which are mapped to individual tags (one tag per album)

For example, there is a tag "ROMA: welcome" and a dynamic album for the rotating home page image using "searchs=ROMA: welcome&searchfields=tags_exact" as its selector

Up to yesterday it was working - today it is not.

In the Admin - Albums page, the dynamic album is indicated as empty

In the Admin - Tags page, that Tag is show as occurring 13 times

To the best of my knowledge we have not updated PHP, ZenPhoto or ZPBootstrap since the end of February when we upgraded to 1.6.a

(The ZP logs show a few deprecated functions which I'm investigating but non appear related to Search)

Search has not functioned since we upgraded to 1.6.a - we can live with that but an almost blank homepage is not ideal! Any suggestions welcome...

Comments

  • acrylian Administrator, Developer

    I assume you mean 1.6.1a and not 1.6a because there is 1.6 of course?

    Deprecated functions should generally not cause this. They should be replaced but as long as they are there they should work.

    Generally alpha versions are not yet complete because in development. But if your last 1.6.1a is from later February you should try the latest as there have been updates meanwhile.

    Search itself was not broken in 1.6 to our knowledge. The only thing that was broken was the searchfields selection on the theme search form. That meanwhile is fixed.

    Also try clearing the search cache or just disable it.

  • My bad - it is 1.6.1a

    I'll try your other suggestions - many thanks

  • I've had the same problem with dynamic albums, and eventually decided the only way to solve it was to delete the offending albums, and then recreate them. This was successful but, when I then pressed the "Refresh Album Metadata" button I lost all of the content, identical to the original problem.
    I have a number of dynamic sub-albums in a real main album, and suspect that I must have refreshed the metadata in the main album, and this then caused the issue in all of the dynamic sub-albums.
    This shouldn't happen (or, at least, the Refresh Album Metadata button should be disabled for dynamic albums).

  • Another minor irritant with dynamic albums is that they don't like brackets (), and maybe other non-alphanumeric characters too, in the album name when first created. If I type "Eastwood (Clint)" as the dynamic album name, what is created is "Eastwood-Clint-". I can alter it back to what I want, but why does it do this?

  • acrylian Administrator, Developer
    edited October 2023

    This shouldn't happen (or, at least, the Refresh Album Metadata button should be disabled for dynamic albums).

    We will have to try to reproduce this. Anything in the logs?

    Note if you refresh metadata and the dynamic search query it will re-read the metadata from images.

    I have a number of dynamic sub-albums in a real main album, and suspect that I must have refreshed the metadata in the main album, and this then caused the issue in all of the dynamic sub-albums.

    Are the image used by these dynamic album within that main album?

    If I type "Eastwood (Clint)" as the dynamic album name, what is created is "Eastwood-Clint-". I can alter it back to what I want, but why does it do this?

    You need to understand the difference between the "name" and the "title". The name is the internal identifiyer, appears in the URL and creates a .alb file on the file system. Not all filesystems work with every char so it is cleared for SEO reason, too. The "title" that is displayed on the pages itself is separate.

    This is the smae for all content item types (albums, images, articles, categories, pages)

  • Re the Refresh Album Metadata issue, I've just pressed the button again in the main album, that had a number of empty dynamic sub-albums, and one sub-album with 37 images in it. After pressing, that sub-album is empty too. I can't see anything relevant in the Logs.

  • The dynamic album as above was created by searching for "Brackenbury" in Tags, looking for images only (it found 37). At the bottom of the Admin screen is "Dynamic album search:
    search=Brackenbury&searchfields=tags&inalbums=0&inimages=1&unpublished=1".
    After pressing Refresh Album Metadata, it now reads "Dynamic album search:
    searchs=Brackenbury&searchfields=tags"
    No images found.

  • acrylian Administrator, Developer
    edited October 2023

    We did some research: Image metadata refresh re-imports all metadata and overwrites existing data. This is actually intended behaviour as leaving out fields that already have data would miss the purpose.

    If the tag the dynamic album is searching was added manually it gets lost because the tags from the metadata overwrite the tags again. This has nothing to do with dynamic albums in special actually.

    As we notice with this issue this is not really properly documented or warned. We already added a note to our user guide article https://www.zenphoto.org/news/zenphoto-image-metadata-processing/ and will see to add a confirm dialog and warning to the buttons with the coming 1.6.1 release.

  • Your question "Are the image used by these dynamic album within that main album?".
    The answer is no.
    The structure I'm trying to set up is that the images are displayed in Real Albums, organised by topic. Each image is tagged with the name of the photographer, and there is a separate real album that contains a dynamic album for each photographers images.

  • acrylian Administrator, Developer

    Okay, the issue is still that somehow you use something to create the dynamic album that is overwritten when re-importing the metadata via refresh.

    The only ways around that is probably to (temporarily) disable the metafields, in your case probably tags, in question from importing. You could do that on Options > Image.

  • I've done a bit of tampering with the Database to try and identify exactly what breaks (if it's not obvious, Nick and I are talking about the same site)
    When CREATING a Dynamic album by searching for a specific text string in tags then creating as a new dynamic album, the search query in the album table in the DB for that dynamic album is of the form "search=Brackenbury&searchfields=tags"
    REFRESHING the album changes this to "searchs=Brackenbury&searchfields=tags"; note the extra letter at the end of the first word just before the equals sign. And the viewed album is now empty.
    If I manually edit the database to remove the "s", the dynamic album immediately works again and is fully populated

  • acrylian Administrator, Developer

    Thanks for the investigation! Now we know what we're looking for we'll take a look as soon as possible where that comes from.

  • acrylian Administrator, Developer

    I think you are seeing a glitch. For 1.6 the search URL was changed to use ?search= for search queries. Since it was easily to be confused with "search" meaning the page in code it has now been changed to ?s=. You should not notice any difference especially for dynamic albums as even those generated before 1.6 are still compatible.

    Please look at the .alb files of your dynamic albums and make the change there manually and see if it works.
    We're sorry for inconvenience but in our tests all old dynamic albums did work and we never had any "searchs". This must be a glitch from the transition due to a failed replacement. Perhaps you used a 1.6.1a in an earlier state where this wasn't fully ready. This all was related to some other search fixes.

  • No apologies required - that's this morning's job (for me) sorted then!

  • The .alb file does not change as the album is (deliberately) broken and repaired. The .alb file for Nick's example is

    WORDS=Bradley
    THUMB=0
    FIELDS=tags
    CONSTRAINTS=inalbums=1&inimages=1&unpublished=0

    and does not change, nor does the time stamp
    The equivalent in the albums table in the DB is

    search=Bradley&searchfields=tags&inalbums=1&inimages=1&unpublished=0

    when working and

    searchs=Bradley&searchfields=tags

    when not

  • acrylian Administrator, Developer
    edited October 2023

    Sorry, my bad, the .alb file indeed should still have:

    words=searchterm

    but in the db it should be

    s=searchterm but search=searchterm also works.

    The totally wrong "searchs" must from a 1.6.1a version where this change was in transition and not fully ready (it's an alpha version after all).

    The dynamicalbum class internally translates "words" to "s" for saving in the database so. Note this is all for the current state of 1.6.1a.

  • Ah - understood - thanks.

Sign In or Register to comment.