[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] customsearch default value selection for UserSelector fields

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a96766db824_3818e4bc590ac@gitlab-sidekiq-low-urgency-cpu-bound-v2-7987d65cf8-nlwpx.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
befb1fff by Victor Emanouilov at 2026-09-01T09:53:26+03:00
[FIX] customsearch default value selection for UserSelector fields

- - - - -


1 changed file:

- lib/wiki-plugins/wikiplugin_customsearch.php


Changes:

=====================================
lib/wiki-plugins/wikiplugin_customsearch.php
=====================================
@@ -1019,6 +1019,12 @@ function cs_design_select($id, $fieldname, $fieldid, $arguments, $default, &$scr
                 }
             }
         } elseif ($field['type'] === 'u') { // User Selector (only when in dropdown list mode)
+            if ($default) {
+                $field['value'] = is_array($default)
+                    ? implode(',', array_filter($default, 'strlen'))
+                    : $default;
+                $handler = TikiLib::lib('trk')->get_field_handler($field);
+            }
             $html = $handler->renderInput([
                 'id' => $arguments['id'] ?? '',
                 'filter_render' => true,
@@ -1033,6 +1039,11 @@ $('#$fieldid').on('change', function() {
     });
 });
 ";
+            if ($default) {
+                $script .= "
+$('#$fieldid').trigger('change');
+";
+            }
             return $html;
         } elseif (in_array($field['type'], ['d','D','R','M'])) { // or types - dropdown, dropdown with other, radio button. multiselect
             $data = $handler->getFieldData();



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

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