[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Trackers: Creating item produces getFieldInfoFromFieldId(): Argument #1...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69b82a809fb62_3b15da04c9714e@gitlab-sidekiq-low-urgency-cpu-bound-v2-69cfcf8ccd-6p6wh.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
29df72a1 by Adrien Mbuya Maloba at 2026-03-16T14:58:04+00:00
[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

- - - - -


1 changed file:

- lib/trackers/trackerlib.php


Changes:

=====================================
lib/trackers/trackerlib.php
=====================================
@@ -5710,14 +5710,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/29df72a1815ed082ccefa33d12ac44ac0bafa340

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