[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Trackers: Creating item produces getFieldInfoFromFieldId(): Argument...

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69b9a622cbf67_3b18c92899051@gitlab-sidekiq-low-urgency-cpu-bound-v2-868547c8bf-q5km7.mail>

Adrien Mbuya Maloba pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
256480d3 by Adrien Mbuya Maloba at 2026-03-17T20:58:07+02:00
[BP][FIX] Trackers: Creating item produces getFieldInfoFromFieldId(): Argument #1 () must be of type int, null given, called in lib\trackers\trackerlib.php on line 5714
---
* [FIX] Trackers: Creating item produces getFieldInfoFromFieldId(): Argument #1 () must be of type int, null given, called in lib\trackers\trackerlib.php on line 5714
---
* [FIX] Trackers: Creating item produces getFieldInfoFromFieldId(): Argument #1 () must be of type int, null given, called in lib\trackers\trackerlib.php on line 5714

See merge request tikiwiki/tiki!9745

See merge request tikiwiki/tiki!9777

- - - - -


1 changed file:

- lib/trackers/trackerlib.php


Changes:

=====================================
lib/trackers/trackerlib.php
=====================================
@@ -5785,14 +5785,17 @@ class TrackerLib extends TikiLib
             }
             include_once('lib/webmail/tikimaillib.php');
             if ($simpleEmail == "n") {
+                $desc = "";
                 $mail_main_value_fieldId = $tracker_definition->getMainFieldId();
-                $mail_main_value_field = $tracker_definition->getFieldInfoFromFieldId($mail_main_value_fieldId);
-                if (in_array($mail_main_value_field['type'], ['r', 'q'])) {
-                    // Item Link & auto-inc are special cases as field value is not the displayed text. There might be other such field types.
-                    $handler = $this->get_field_handler($mail_main_value_field);
-                    $desc = $handler->renderOutput(['list_mode' => 'csv']);
-                } else {
-                    $desc = $this->get_item_value($trackerId, $itemId, $mail_main_value_fieldId);
+                if ($mail_main_value_fieldId) {
+                    $mail_main_value_field = $tracker_definition->getFieldInfoFromFieldId($mail_main_value_fieldId);
+                    if (in_array($mail_main_value_field['type'], ['r', 'q'])) {
+                        // Item Link & auto-inc are special cases as field value is not the displayed text. There might be other such field types.
+                        $handler = $this->get_field_handler($mail_main_value_field);
+                        $desc = $handler->renderOutput(['list_mode' => 'csv']);
+                    } else {
+                        $desc = $this->get_item_value($trackerId, $itemId, $mail_main_value_fieldId);
+                    }
                 }
                 $smarty = TikiLib::lib('smarty');
                 $desc = $this->removeInlineSyntaxTags($desc);



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/256480d3d2b71e2f5aac88a41ea06079a4d5dc28
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

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