Closed dmahurin closed 9 years ago
Fine, this was my misunderstanding to the idea of no tabs. I repair it, but it'll be a little bit complicated.
Your change has wrong requirement that if you have only one group it must be with id 0. Eg. if you have only one group "2015" it will not be dispalyed because count of albums is not greater than 1 (it's exactly 1) but index 0 is not set in $albs_by_year array. Only index "2015" is set. So we have to check that only one key irrespectively to its name. I'll commit this update in few minutes.
I have recently pushed a fixed version with correct handling of only one group with empty string in name to display gallery with no tabs.
restore ability to have no groups ( with no tabs shown).
I think my previous change may have been misinterpreted.
Note, these lines are not equivalent. The first is checking for a special case of a single element with an empty string. The replacement required that the first element was never empty. Perhaps ()'s would have made the order of operations clearer. I added ()'s in this pull request to make it clearer.
The purpose of the special case was to allow no grouping (no tabs) at allow with a function like:
function get_groupname($bn) { return ''; }
The above logic change combined with the 'Fix of broken grouping' change broke this functionality.