[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <6894bdece0e1b_2cd5bd87191@gitlab-sidekiq-low-urgency-cpu-bound-v2-fcfcfbbb-nh5mq.mail>

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


Commits:
b5a5346f by Victor Emanouilov at 2025-08-07T17:53:23+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/b5a5346f5d79d1038a576e155ddba9e325fc5d42

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