[TikiWiki-commits] [Git][tikiwiki/tiki][27.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 <69ba9652851fc_3b18d1c08662d@gitlab-sidekiq-low-urgency-cpu-bound-v2-7845844f5c-wvpgq.mail>

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


Commits:
fd5653c2 by Adrien Mbuya Maloba at 2026-03-18T14:02:26+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!9784

- - - - -


1 changed file:

- lib/trackers/trackerlib.php


Changes:

=====================================
lib/trackers/trackerlib.php
=====================================
@@ -5762,14 +5762,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/fd5653c2f6985a480fa65ad9723270dda499cc42

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