[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] listexecute: select all bug
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]> Wed, 22 Jul 2026 13:48:25 +0000
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a60ca299c26d_3819d250326c3@gitlab-sidekiq-low-urgency-cpu-bound-v2-7d8cd68bcd-k86bs.mail> |
Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
a0ffe970 by Victor Emanouilov at 2026-07-22T16:47:57+03:00
[FIX] listexecute: select all bug
---
* [FIX] listexecute: select all bug - when checking all items on a page but there are more pages (even if hidden), frontend shouldn't send the ALL value, so backend processes only selected items on page and not all the items found via the plugin
See merge request tikiwiki/tiki!10769
- - - - -
3 changed files:
- lib/jquery_tiki/wikiplugin-listexecute.js
- templates/search/list/table.tpl
- templates/wiki-plugins/wikiplugin_listexecute.tpl
Changes:
=====================================
lib/jquery_tiki/wikiplugin-listexecute.js
=====================================
@@ -2,6 +2,8 @@ $.fn.setupListExecute = function (id) {
const $container = this;
const iListExecute = $container.attr('id').replace('wplistexecute-', '').replace('listexecute-', '');
+ let selectAllClicked = false;
+
let countChecked = function() {
if ($container.find('.checkbox_objects').is(':checked')) {
if($container.find('select.check_submit_select').val()){
@@ -10,12 +12,17 @@ $.fn.setupListExecute = function (id) {
} else {
$container.find('input.list_execute_submit').prop('disabled', true);
}
- var header_checked = $container.find('.checkbox_objects').not(':checked').length == 0;
- $container.find('.listexecute-all').val(header_checked ? 'ALL' : '');
+ var $checkboxes = $container.find('.checkbox_objects');
+ var header_checked = $checkboxes.not(':checked').length == 0;
+ var totalCount = parseInt($container.data('count')) || 0;
+ var isPaginated = totalCount > 0 && totalCount > $checkboxes.length;
+ var sendAll = header_checked && (!isPaginated || selectAllClicked);
+ $container.find('.listexecute-all').val(sendAll ? 'ALL' : '');
};
$container.find('.listexecute-select-all').removeClass('listexecute-select-all')
.on('click', function (e) {
+ selectAllClicked = true;
$(this).closest('form').find('tbody :checkbox:not(:disabled), .list li :checkbox:not(:disabled)').each(function () {
$(this).prop("checked", ! $(this).prop("checked"));
}).promise().done(function(){ countChecked(); });
@@ -61,7 +68,10 @@ $.fn.setupListExecute = function (id) {
}
});
- $container.find(".checkbox_objects").on("click", countChecked);
+ $container.find(".checkbox_objects").on("click", function() {
+ selectAllClicked = false;
+ countChecked();
+ });
countChecked();
let submitForm = function() {
=====================================
templates/search/list/table.tpl
=====================================
@@ -46,7 +46,7 @@
{/if}
{/if}
{if $actions}
-<form method="post" action="#{$id}" class="d-flex flex-row flex-wrap align-items-center list-executable" id="listexecute-{$iListExecute}" data-id="{$id}"{if $tsOn} data-page-reload="1"{/if}>
+<form method="post" action="#{$id}" class="d-flex flex-row flex-wrap align-items-center list-executable" id="listexecute-{$iListExecute}" data-id="{$id}" data-count="{$count}"{if $tsOn} data-page-reload="1"{/if}>
<input type="hidden" name="plugin" value="{$fingerprint}">
{ticket}
{/if}
=====================================
templates/wiki-plugins/wikiplugin_listexecute.tpl
=====================================
@@ -1,5 +1,5 @@
<a name="listexecute_{$iListExecute}"></a>
-<form method="post" action="#listexecute_{$iListExecute}" class="d-flex flex-column flex-wrap list-executable" id="listexecute-{$iListExecute}" data-id="{$id}"{if $tsOn} data-page-reload="1"{/if}>
+<form method="post" action="#listexecute_{$iListExecute}" class="d-flex flex-column flex-wrap list-executable" id="listexecute-{$iListExecute}" data-id="{$id}" data-count="{$count}"{if $tsOn} data-page-reload="1"{/if}>
<input type="hidden" name="plugin" value="{$fingerprint}">
<input type="hidden" name="objects{$iListExecute}[]" value="" class="listexecute-all">
{ticket}
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a0ffe970542bac5c026390b34de7bdab031b0b0f
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a0ffe970542bac5c026390b34de7bdab031b0b0f
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs