[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [BP][FIX] Page Selector not loading in modal when used multiple times

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6901fb344433c_2d141bbc025014@gitlab-sidekiq-low-urgency-cpu-bound-v2-5b9d85dfcf-xflxp.mail>

Victor Emanouilov pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki


Commits:
64072a49 by Yves Ngalamulume at 2025-10-29T11:24:30+00:00
[BP][FIX] Page Selector not loading in modal when used multiple times
---
* [BP][FIX] Page Selector not loading in modal when used multiple times
---
* [FIX] Page Selector not loading in modal when used multiple times
---
* [FIX] Generate unique IDs for PageSelector input fields

* [FIX] Generate unique IDs for PageSelector input fields

* [FIX] PageSelector: Simplify uniqueId generation in renderInput method

* [FIX] PageSelector: Ensure uniqueId is consistently assigned for input elements

* [FIX] PageSelector: Generate uniqueId in renderInput method for improved element identificatio

* [FIX] PageSelector: Add uniqueId to field data for improved identification

* [FIX] Page Selector not loading in modal when used multiple times

* [FIX] PageSelector: Ensure default value is always provided in getFieldData method

* [FIX] PageSelector: Ensure default value is always provided in getFieldData method

* [FIX][UI] PageSelector: Refactor to use a select dropdown instead of text input for better usability

* [FIX] Remove redundant autocomplete script from page selector template

* [FIX] Correct unique ID assignment for page selector input and update autocomplete element reference

See merge request tikiwiki/tiki!8766

See merge request tikiwiki/tiki!8895

See merge request tikiwiki/tiki!8896

- - - - -


2 changed files:

- lib/core/Tracker/Field/PageSelector.php
- templates/trackerinput/pageselector.tpl


Changes:

=====================================
lib/core/Tracker/Field/PageSelector.php
=====================================
@@ -79,6 +79,10 @@ class Tracker_Field_PageSelector extends \Tracker\Field\AbstractItemField
 
     public function renderInput($context = [])
     {
+        $itemId = $this->getItemId();
+        $itemIdPart = null !== $itemId ? '_' . $itemId : '';
+        $context['uniqId'] = 'field' . $this->getFieldId() . '_item' . $itemIdPart . '_' . uniqid();
+
         return $this->renderTemplate('trackerinput/pageselector.tpl', $context);
     }
 


=====================================
templates/trackerinput/pageselector.tpl
=====================================
@@ -1,10 +1,10 @@
 {if $field.options[0] != 1 || $tiki_p_admin_trackers == 'y'}
-    <input type="text" id="page_selector_{$field.fieldId}" name="{$field.ins_id}" class="form-control"
+    <input type="text" id="page_selector_{$context.uniqId}" name="{$field.ins_id}" class="form-control"
         {if $field.options_array[1] gt 0}size="{$field.options_array[1]}"{/if}
         value="{if !empty($field.value)}{$field.value|escape}{/if}"
     >
 
-    {autocomplete element="#page_selector_`$field.fieldId`" type='pagename'}
+    {autocomplete element="#page_selector_`$context.uniqId`" type='pagename'}
 {else}
     {$field.value|escape}
 {/if}



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/64072a498a14377ca340f3d678b583f56bfe0697
You're receiving this email because of your account on gitlab.com.

_______________________________________________
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.