Hello/Hi/Greetings,
If album "A" has an id of 9 and it belongs to album "B" of id 10, why in the uppercats cell in the piwigo_categories table its own is also included?
That is, the uppercats for album "A" are 9,10, where it should be just 10.
So if I use the Piwigo function get_subcat_ids(), it will always return a subcat because every album is its own uppercat.
It seems curious to have it be written this way. Is there a reason for this?
Also, if my database is borken and it shouldn't work like that please let me know as well. :)
Thank you.
Last edited by Crythes (2023-12-08 15:27:12)
Offline
Think of it as a path to reach the album, or a tree's branch that includes the leaf node. You'll also see that when B(10) would be a sub-album of C(8) then the sequence would be 8,10,9.
Btw, your example of A(9) belonging to (being a sub-album of) B(10) and uppercats 9,10 is reverse, it should be 10,9 instead.
But I don't know why this decision to include the very album was made.
Offline
erAck wrote:
But I don't know why this decision to include the very album was made.
I don't remember but I think it's a good choice :-) It's like the "path" of a directory: it includes the directory itself.
~/git/Piwigo/plugins/TakeATour[master|✔] % pwd /Users/plg/git/Piwigo/plugins/TakeATour
I'm in the "TakeATour" directory and when I ask to "print working directory", it includes the directory "TakeATour" itself.
The piwigo_images.uppercats data is just like the directory path, but with album (category) identifiers.
Offline
I see, thanks for the explanations, it does make sense.
Offline