[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] tracker-edit-jquery - tiki-jquery.js buildParams avoid object object query serialization

"Sammy Ndabo \(@ndabosam084\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <699733e224502_3b186dac4085c@gitlab-sidekiq-low-urgency-cpu-bound-v2-9fdfc94f7-rvbxd.mail>

Sammy Ndabo pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
cdf6f2ed by Sammy Ndabo at 2026-02-19T15:48:45+00:00
[FIX] tracker-edit-jquery - tiki-jquery.js buildParams avoid object object query serialization
---
* [FIX] Fix $.buildParams on multi-entries nested objects, and nested but empty objects

* Revert "[FIX] js buildParams avoid object object query serialization"

This reverts commit 7f17bf8664c83b78dd3fbbbab94e012a4346833c.

* [FIX] js buildParams avoid object object query serialization

See merge request tikiwiki/tiki!9594

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-jquery.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -1513,18 +1513,19 @@ $(document).tiki('copy')(
         $.paramsToProcessLength = $.paramsToProcessLength || Object.keys(query).length;
 
         for (const [key, value] of Object.entries(query)) {
-            if ($.isPlainObject(value)) {
+            if ($.isPlainObject(value) && ! $.isEmptyObject(value)) {
                 _keysNamespace.push(key);
                 const keyNamespace = _keysNamespace.at(-2);
                 const prefixInner = (keyNamespace ? `${keyNamespace}~`: '') + key + '[';
 
-                $.paramsToProcessLength++;
+                $.paramsToProcessLength += Object.keys(value).length - 1;
 
                 params.push(...$.buildParams(value, prefixInner, ']', _keysNamespace));
             } else if (Array.isArray(value)) {
                 value.forEach(function (av) {
                     params.push({[`${prefix}${key}${suffix}[]`]: av});
                 });
+                $.paramsToProcessLength--;
             } else {
                 params.push({[`${prefix}${key}${suffix}`]: value});
                 $.paramsToProcessLength--;



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cdf6f2ede9bd4e1fe718fda0eca6e18121720789

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cdf6f2ede9bd4e1fe718fda0eca6e18121720789
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.