[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Article field: the Preview button doesnt show the selected articles

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69c59fbba368b_3b18f36c-3c0@gitlab-sidekiq-low-urgency-cpu-bound-v2-5b596b4d8c-ssbxt.mail>

Adrien Mbuya Maloba pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
f7b198f8 by Joel Mpunga at 2026-03-26T22:58:23+02:00
[FIX] Article field: the Preview button doesnt show the selected articles
---
* [FIX] Article field: the Preview button doesnt show the selected articles

See merge request tikiwiki/tiki!8708

- - - - -


2 changed files:

- lib/core/Services/Tracker/Controller.php
- lib/jquery_tiki/tiki-trackers.js


Changes:

=====================================
lib/core/Services/Tracker/Controller.php
=====================================
@@ -1594,6 +1594,9 @@ class Services_Tracker_Controller
             if (isset($f['files'])) {
                 $fieldsProcessed[$permName] = ['files' => $f['files']];
             }
+            if (isset($f['articleIds'])) {
+                $fieldsProcessed[$permName]['articleIds'] = $f['articleIds'];
+            }
         }
 
         $fieldDefinitions = $definition->getFields();
@@ -1703,6 +1706,9 @@ class Services_Tracker_Controller
                 if (isset($fieldsProcessed[$permName]['files'])) {
                     $field['files'] = $fieldsProcessed[$permName]['files'];
                 }
+                if (isset($fieldsProcessed[$permName]['articleIds'])) {
+                    $field['articleIds'] = $fieldsProcessed[$permName]['articleIds'];
+                }
             }
         }
 


=====================================
lib/jquery_tiki/tiki-trackers.js
=====================================
@@ -656,9 +656,20 @@
             }
 
             if (fieldName) {
-                fieldName = fieldName.replace('[]', '');
+                // Handle array fields (fields with [] in name)
+                if (fieldName.endsWith('[]')) {
+                    let baseFieldName = fieldName.replace('[]', '');
+                    if (!fields[baseFieldName]) {
+                        fields[baseFieldName] = [];
+                    }
+                    // Only add non-empty values to avoid empty placeholder values
+                    if (fieldValue && fieldValue !== '') {
+                        fields[baseFieldName].push(fieldValue);
+                    }
+                } else {
+                    fields[fieldName] = fieldValue;
+                }
             }
-            fields[fieldName] = fieldValue;
         });
 
         let options = [];



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f7b198f81692a670adb3d0e8ef4440d8336c7582
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.