[TikiWiki-commits] [Git][tikiwiki/tiki][28.x] [FIX] add trackerinput smarty function param fieldId to work similarly to...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6894be27c0459_2cd5b7466f0@gitlab-sidekiq-low-urgency-cpu-bound-v2-fcfcfbbb-gfctr.mail>

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


Commits:
da7f1919 by Victor Emanouilov at 2025-08-07T17:53:54+03:00
[FIX] add trackerinput smarty function param fieldId to work similarly to trackeroutput where users can pass the field ID to get an input element for

- - - - -


1 changed file:

- lib/smarty_tiki/FunctionHandler/TrackerInput.php


Changes:

=====================================
lib/smarty_tiki/FunctionHandler/TrackerInput.php
=====================================
@@ -16,7 +16,17 @@ class TrackerInput extends Base
     {
         $trklib = \TikiLib::lib('trk');
 
-        $field = $params['field'];
+        if (isset($params['fieldId'])) {
+            $field = $trklib->get_tracker_field($params['fieldId']);
+            $field['ins_id'] = "ins_{$params['fieldId']}";
+            $handler = $trklib->get_field_handler($field, $item);
+            if ($handler) {
+                $field = array_merge($field, $handler->getFieldData());
+            }
+        } else {
+            $field = $params['field'];
+        }
+
         if (isset($params['item'])) {
             $item = $params['item'];
         } elseif (! empty($params['itemId'])) {



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

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