[Tag Manager] incorrect number of images when filtering #1192

Closed
opened 2026-10-05 00:35:29 +02:00 by adam · 0 comments
Owner

After changing or clearing the filter, some or even all tags are marked with no photos in the pull down menu. I fixed this bug in the file:

admin/themes/default/js/tags.js

`function updatePage() {
return new Promise((resolve, reject) => {
newPage = actualPage;
dataToDisplay = tagToDisplay();
tagBoxes = $('.tag-box');
$('.pageLoad').fadeIn();;
$('.tag-box, .tag-pagination').animate({ opacity: 0 }, 500).promise().then(() => {

  let displayTags = new Promise((res, rej) => {
    boxToRecycle = Math.min(dataToDisplay.length, tagBoxes.length);

    for (let i = 0; i < boxToRecycle; i++) {
      let tag = dataToDisplay[i];
      recycleTagBox($(tagBoxes[i]), tag.id, tag.name, tag.url_name, tag.counter)
    }

    if (dataToDisplay.length < tagBoxes.length) {
      for (let j = boxToRecycle; j < tagBoxes.length; j++) {
        $(tagBoxes[j]).remove();
      }
    } else if (dataToDisplay.length > tagBoxes.length) {
      for (let j = boxToRecycle; j < dataToDisplay.length; j++) {
        let tag = dataToDisplay[j];
 ->>>       newTag = createTagBox(tag.id, tag.name, tag.url_name, tag.counter);
        newTag.css('opacity', 0);
        $('.tag-container').append(newTag);
        setupTagbox(newTag);
      }
    }`

The call of function "createTagBox" missing a parameter "tag.counter"

After changing or clearing the filter, some or even all tags are marked with no photos in the pull down menu. I fixed this bug in the file: admin/themes/default/js/tags.js `function updatePage() { return new Promise((resolve, reject) => { newPage = actualPage; dataToDisplay = tagToDisplay(); tagBoxes = $('.tag-box'); $('.pageLoad').fadeIn();; $('.tag-box, .tag-pagination').animate({ opacity: 0 }, 500).promise().then(() => { let displayTags = new Promise((res, rej) => { boxToRecycle = Math.min(dataToDisplay.length, tagBoxes.length); for (let i = 0; i < boxToRecycle; i++) { let tag = dataToDisplay[i]; recycleTagBox($(tagBoxes[i]), tag.id, tag.name, tag.url_name, tag.counter) } if (dataToDisplay.length < tagBoxes.length) { for (let j = boxToRecycle; j < tagBoxes.length; j++) { $(tagBoxes[j]).remove(); } } else if (dataToDisplay.length > tagBoxes.length) { for (let j = boxToRecycle; j < dataToDisplay.length; j++) { let tag = dataToDisplay[j]; ->>> newTag = createTagBox(tag.id, tag.name, tag.url_name, tag.counter); newTag.css('opacity', 0); $('.tag-container').append(newTag); setupTagbox(newTag); } }` The call of function "createTagBox" missing a parameter "tag.counter" <!-- github-sync-id:834095941 -->
adam closed this issue 2026-10-05 00:35:29 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1192