[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [FIX] ListExecute actions on wiki pages with itemId in URL
"Domeshow Emmanuel \(@Domeshow\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a75c61079437_3919f6cc3081c@gitlab-sidekiq-low-urgency-cpu-bound-v2-7cbf9c6f65-msxpb.mail> |
Domeshow Emmanuel pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki Commits: c293b59c by Domeshow Emmanuel at 2026-08-07T14:41:02+03:00 [FIX] ListExecute actions on wiki pages with itemId in URL --- * [FIX] ListExecute actions on wiki pages with itemId in URL --- * [FIX] ListExecute actions on wiki pages with itemId in URL See merge request tikiwiki/tiki!10822 (cherry picked from commit 8f42a98c20186d2fdea5a6a6645616fd14c4d0db) a76a6c70 [FIX] ListExecute actions on wiki pages with itemId in URL Co-authored-by: Domeshow Emmanuel <[email protected]> See merge request tikiwiki/tiki!10859 - - - - - 2 changed files: - lib/core/Sections.php - lib/jquery_tiki/wikiplugin-listexecute.js Changes: ===================================== lib/core/Sections.php ===================================== @@ -364,11 +364,15 @@ class Sections // Pretty tracker pages return the tracker item object instead of the parent wiki page object // We expose the parent wiki page type and objectId for the benefit of modules, plugins or smarty functions which may want to access the parent page categories and permissions if (self::isCurrentSection(self::SECTION_WIKI_PAGE) && isset($request['itemId'])) { + $parentObject = $cat_objid; + if (empty($parentObject) && ! empty($request['page'])) { + $parentObject = $request['page']; + } return [ 'type' => 'trackeritem', 'object' => (int)$request['itemId'], 'parentType' => $cat_type, - 'parentObject' => $cat_objid, + 'parentObject' => $parentObject, ]; } ===================================== lib/jquery_tiki/wikiplugin-listexecute.js ===================================== @@ -1,3 +1,14 @@ +let getListExecutePageName = function() { + const currentObject = jqueryTiki.current_object; + const page = (currentObject && ( + currentObject.type + ? (currentObject.type === 'wiki page' ? currentObject.object : currentObject.parentObject) + : currentObject.object + )) || (new URLSearchParams(window.location.search).get('page')) || decodeURIComponent(((window.location.pathname || '').split('/').pop()) || '').replace(/\+/g, ' '); + + return encodeURIComponent(page); +}; + $.fn.setupListExecute = function (id) { const $container = this; const iListExecute = $container.attr('id').replace('wplistexecute-', '').replace('listexecute-', ''); @@ -81,7 +92,7 @@ $.fn.setupListExecute = function (id) { $.ajax({ url: $.service('wiki', 'execute'), type: 'POST', - data: `page=${encodeURIComponent((jqueryTiki.current_object && jqueryTiki.current_object.object) || (new URLSearchParams(window.location.search).get('page')) || decodeURIComponent(((window.location.pathname || '').split('/').pop()) || '').replace(/\+/g, ' '))}&` + $container.serialize() + '&' + (new URLSearchParams(window.location.search).toString()), + data: `page=${getListExecutePageName()}&` + $container.serialize() + '&' + (new URLSearchParams(window.location.search).toString()), success: function(data) { modal.tikiModal(); $('#tikifeedback .alert.alert-dismissible').remove(); @@ -185,7 +196,7 @@ $.fn.reloadListExecute = function() { $.ajax({ url: $.service('wiki', 'execute'), type: 'GET', - data: `page=${encodeURIComponent((jqueryTiki.current_object && jqueryTiki.current_object.object) || (new URLSearchParams(window.location.search).get('page')) || decodeURIComponent(((window.location.pathname || '').split('/').pop()) || '').replace(/\+/g, ' '))}&` + $container.serialize() + '&' + (new URLSearchParams(window.location.search).toString()), + data: `page=${getListExecutePageName()}&` + $container.serialize() + '&' + (new URLSearchParams(window.location.search).toString()), success: function(data) { modal.tikiModal(); let id = $container.data('id'); View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c293b59c4fb71b1b840e791e289c5a1f46e3fd9f -- View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c293b59c4fb71b1b840e791e289c5a1f46e3fd9f 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