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

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


Commits:
42297e2a by Victor Emanouilov at 2025-08-07T17:54:07+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/42297e2a76753ddd1f02da60e6b10e1507e3cfb1

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