[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][FIX] trackers: Another fix for invalid date values in item history

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a15ce0293b73_381233b3c22092@gitlab-sidekiq-low-urgency-cpu-bound-v2-cb9bccbb8-bczdx.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
5e2c88e6 by luci at 2026-05-26T15:39:54+00:00
[BP][FIX] trackers: Another fix for invalid date values in item history
---
* [FIX] trackers: Another fix for invalid date values in item history
---
* [FIX] trackers: Similar fix to !8744 but for a slightly different edge case, where a non-numeric value has been stored in a linked field in the item history. It was failing without rendering the historical data available which could help with debugging and repair.

See merge request tikiwiki/tiki!10278


(cherry picked from commit 36eecbecb09cf74185eed447535422bbd2bd263c)

fbae5c09 [FIX] trackers: Similar fix to !8744 but for a slightly different edge case,...

Co-authored-by: Jonny Bradley <[email protected]>

(cherry picked from commit 3ee0066bb63640e33c1c1b5039fe050999b919ed)

Co-authored-by: Jonny Bradley <[email protected]>

(cherry picked from commit c20d2d5ef4ef4f0eff375fa74ff755d51ae992b4)

Co-authored-by: luci <gitlab-TfYQc8/[email protected]>

See merge request tikiwiki/tiki!10370

- - - - -


2 changed files:

- lib/core/Tracker/Field/AbstractItemField.php
- lib/trackers/trackerlib.php


Changes:

=====================================
lib/core/Tracker/Field/AbstractItemField.php
=====================================
@@ -234,12 +234,16 @@ abstract class AbstractItemField implements ItemFieldInterface, IndexableInterfa
             if ($this->getConfiguration('type') === 'e' && is_string($old)) {   // category fields need an array input
                 $old = explode(',', $old);
             }
-            $this->definition = array_merge($this->definition, $this->getFieldData([$key => $old]));
-            $this->itemData[$this->getConfiguration('fieldId')] = $old;
-            $old = $this->renderInnerOutput($innerOutputContext);
-            $old = str_replace(['%%%', '<br>', '<br/>'], ["\n", ' ', ' '], $old);
-            $this->definition = $old_definition;
-            $this->itemData[$this->getConfiguration('fieldId')] = $new;
+            try {
+                $this->definition = array_merge($this->definition, $this->getFieldData([$key => $old]));
+                $this->itemData[$this->getConfiguration('fieldId')] = $old;
+                $old = $this->renderInnerOutput($innerOutputContext);
+                $old = str_replace(['%%%', '<br>', '<br/>'], ["\n", ' ', ' '], $old);
+                $this->definition = $old_definition;
+                $this->itemData[$this->getConfiguration('fieldId')] = $new;
+            } catch (\Exception $e) {
+                $old = tr('Error on field #%0: "%1"', $this->getConfiguration('fieldId'), $e->getMessage());
+            }
         }
         $new = $this->renderInnerOutput($innerOutputContext);
         $new = str_replace(['%%%', '<br>', '<br/>'], ["\n", ' ', ' '], $new);


=====================================
lib/trackers/trackerlib.php
=====================================
@@ -6578,8 +6578,12 @@ class TrackerLib extends TikiLib
                 } else {
                     $requestData = $field;
                 }
-                $linkedField = $handler->getFieldData($requestData);
-                $field = array_merge($field, $linkedField);
+                try {
+                    $linkedField = $handler->getFieldData($requestData);
+                    $field = array_merge($field, $linkedField);
+                } catch (Exception $e) {
+                    Feedback::error(tr('Error on linked field %0: %1', $field['fieldId'], $e->getMessage()));
+                }
                 $field['ins_id'] = 'ins_' . $field['fieldId'];
                 if (isset($field['value']) && $field['type'] == 'S') {
                     $item[$field['fieldId']] = $field['value'];



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5e2c88e69e54de7d60ce49302f2707b6ecc5f52f

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