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

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


Commits:
6e7f36d4 by Victor Emanouilov at 2025-08-07T17:55:45+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/function.trackerinput.php


Changes:

=====================================
lib/smarty_tiki/function.trackerinput.php
=====================================
@@ -8,7 +8,17 @@ function smarty_function_trackerinput($params, $smarty)
 {
     $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/6e7f36d40e39934a6ac0fd88b8bd780214ecf33d

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