Inconsistency using printAllTagsAs function

I have a couple of problems using the printAllTagsAs function:

1) When displaying the tags on - for example - this page, the number of tags for "Format carré" is displayed as 19, though only 12 are returned as the search result... if you're a visitor!
As the admin, I can see 19 thumbnails, 7 of them being duplicates with a wrong URL (a double slash in the path, instead of a simple one).

2) I have a "Blanc" (= white color) tag affected to 3 pictures, and it displays a count of 3. I also have a "Noir et blanc" (for black and white pictures) tag that displays a count of ... 38 though only 18 thumbnails are returned when the tag is clicked upon.
But the "Blanc (3)" also returns the "Noir et blanc" pictures!

Here is the syntax I currently use:
`printAllTagsAs('cloud', 'content', 'abc', TRUE, TRUE, 1, 10, 2,NULL,1)`

and you can see the results on the gallery, there is a 'Tags' tab at the bottom right of each page.

I'm using Zenphoto last version (upgraded this morning), have tried to empty the images caches, and update the DB, but with no result.

Thanks for helping.

Comments

  • In fact, I'm not sure the problems are completely related to the printAllTags function as I just realized I get the same results with the Default theme.
    The only thing that is different is the Default theme doesn't display the number of tags prior to display the thumbnails, so no discrepancy is visible; but I still have double thumbnails when I'm logged as admin, and a 'normal' situation as a visitor.
  • acrylian Administrator, Developer
    What are your search settings? You can set if you want tags to be searched partial or exact. If the first "blanc" will trigger "noir et blanc".

    As the logged in admin with appropiate rights you always see and get unpublished and/or protected items displayed.

    This all has nothing to do with the theme itself.
  • Thanks for your answer: I hadn't seen this option for exact match for tags; now "Blanc" returns only the 3 pictures I was looking for, and none of the "Noir et blanc" tagged. Question 2 solved.

    Question 1 remains, though:
    - the number of tagged pictures returned by the `printAllTagsAs` function is not correct (from the visitor's point of view, but it appears to match the number of thumbnails I get when I'm connected)
    - and when I'm connected as admin, the search page returns two or three identical thumbnails with different URL, some of them having double slashes; for example, I get these:
    http://www.marie-noelle-augendre.com/photos//galerie/portraits/IMG_9767_03.jpg.php
    http://www.marie-noelle-augendre.com/photos/galerie//portraits/IMG_9767_03.jpg.php
    http://www.marie-noelle-augendre.com/photos/galerie/portraits/IMG_9767_03.jpg.php

    PS: If you want to check, these were the first 3 thumbnails I got when using the tag "Noir et blanc" in the bottom TAGS tab.
  • acrylian Administrator, Developer
    Probaby best open a ticket for this so we can further investigate this and don't forget it.

    I thought somehow we had fixed this behaviour already.
  • You might want to refresh your database. If there are two entries for an image as you note both will be returned. The double slash entries are incorrect but because of file system quirks do "work".

    If refresh does not remove them you will have to do so manually.
  • The database is a complete mess! Refresh doesn't work and goes on looping.

    Using PhpMyAdmin, I've already cleaned the `images` table: most of them were there 2 or 3 times, sometimes even 4 or 5 records for the same picture...
    For the `albums` table, I have folders beginning with a `/`, and others without; which one is the correct syntax?
  • Several minutes later: after the whole 'cleaning', the DB refresh eventually worked; the tags search seems to be OK now, and the tags counts are right.
    There is still the `albums` table that needs some cleaning as albums seem to appear twice: one with a leading slash, and one without; and I don't know which one I must remove.
    Thanks for information on the subject.

    And I guess something might have gone wrong either in this last version or a previous one, as the theme I've developed uses what's in the DB, but never write in the database; and I had never used PhpMyAdmin previously with the Zenphoto DB.
  • Remove the leading slash ones.
  • OK, thanks.
    The cleaning is finished, I've refreshed the DB one more time, and the gallery seems to run smoothly now.

    Still don't know what could have happened... some problem in the DB update during upgrades, maybe?
Sign In or Register to comment.