You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Albums that are composed solely of sub-albums (that is to say, the album does not have any direct image descendents) cannot extract a modification time, because it's expecting at least one image in the level below it.
Solution
Easiest way to get around this is just to keep at least one image in the album itself.
The logic for obtaining album $modDate should recursively access modification times to order albums if there do not exist any images in the level directly below it. I suspect it might be done here;
Instead of returning an empty string, it might dig down to the first album that has images as a direct descendant. I might work on this but again I'm not great at PHP so it would take me a little longer, and this seems like a relatively simple fix.
Details
I have debugged this issue by placing the following code in the nova-themes/novagallery/home.php file, around line 17:
It displayed a missing $modDate for the out-of-order album:
I suspect when it goes to get array_values($images)[0], it is expecting that at least one of the values in the array is a timestamp. But if all the elements of the array are albums, then the value isn't a straight time-stamp value, it's a key-value array of more images. To test this theory, if I placed at least one image in the out-of-order album, then it should reflect a correct modification time -- and it does.
Notice the 2015 album now has a value for $modDate and is ordered correctly.
The logic here therefore should recursively access modification times to order albums if there do not exist any images in the level directly below it.
The text was updated successfully, but these errors were encountered:
Problem
Album ordering is not as expected.
Issue
Albums that are composed solely of sub-albums (that is to say, the album does not have any direct image descendents) cannot extract a modification time, because it's expecting at least one image in the level below it.
Solution
Easiest way to get around this is just to keep at least one image in the album itself.
The logic for obtaining album
$modDate
should recursively access modification times to order albums if there do not exist any images in the level directly below it. I suspect it might be done here;novagallery/src/nova-base/lib/novaGallery.php
Line 264 in b14352f
Instead of returning an empty string, it might dig down to the first album that has images as a direct descendant. I might work on this but again I'm not great at PHP so it would take me a little longer, and this seems like a relatively simple fix.
Details
I have debugged this issue by placing the following code in the
nova-themes/novagallery/home.php
file, around line 17:It displayed a missing
$modDate
for the out-of-order album:I suspect when it goes to get array_values($images)[0], it is expecting that at least one of the values in the array is a timestamp. But if all the elements of the array are albums, then the value isn't a straight time-stamp value, it's a key-value array of more images. To test this theory, if I placed at least one image in the out-of-order album, then it should reflect a correct modification time -- and it does.
Notice the 2015 album now has a value for
$modDate
and is ordered correctly.The logic here therefore should recursively access modification times to order albums if there do not exist any images in the level directly below it.
The text was updated successfully, but these errors were encountered: