[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Tracker: Fix multilingual text field rendering as item title

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]> Tue, 30 Jun 2026 14:27:41 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a43d25de4edd_3849853c494274@gitlab-sidekiq-low-urgency-cpu-bound-v2-656d6f88d7-9n5jc.mail>

luci pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
fbab35b2 by Landry Bitege at 2026-06-30T14:18:41+00:00
[BP][FIX] Tracker: Fix multilingual text field rendering as item title
---
* [BP][FIX] Tracker: Fix multilingual text field rendering as item title
---
* [FIX] Tracker: Fix multilingual text field rendering as item title
---
* [FIX] Tracker: Fix multilingual text field rendering as item title

See merge request tikiwiki/tiki!10542

(cherry picked from commit ba29b176d3bd43994e141a8a3cfae3dfb9680392)

See merge request tikiwiki/tiki!10597

(cherry picked from commit 19ddac0bcfe477f1ef464075f1583c99ccac29b2)

See merge request tikiwiki/tiki!10617

- - - - -


2 changed files:

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


Changes:

=====================================
lib/core/Tracker/Field/Text.php
=====================================
@@ -162,6 +162,21 @@ class Tracker_Field_Text extends \Tracker\Field\AbstractItemField implements \Tr
         }
     }
 
+    public function renderText($context = [])
+    {
+        $value = $this->getValue();
+
+        if ($this->getConfiguration('isMultilingual') == 'y') {
+            $decoded = json_decode($value, true);
+            if (is_array($decoded)) {
+                $language = Language::getCurrentLanguage();
+                $value = $decoded[$language] ?? (reset($decoded) ?: '');
+            }
+        }
+
+        return trim(strip_tags((string) $value));
+    }
+
     protected function processMultilingual($requestData, $id_string)
     {
         global $prefs;


=====================================
lib/trackers/trackerlib.php
=====================================
@@ -4243,7 +4243,7 @@ class TrackerLib extends TikiLib
                 return $cache[$cacheKey];
             }
         }
-        $query = "SELECT tif.`value`, tf.`type`, tf.`fieldId`, i.`trackerId`
+        $query = "SELECT tif.`value`, tf.`type`, tf.`fieldId`, tf.`options`, tf.`isMultilingual`, i.`trackerId`
                 FROM `tiki_tracker_item_fields` tif
                 JOIN `tiki_tracker_items` i ON i.`itemId` = tif.`itemId`
                 JOIN `tiki_tracker_fields` tf ON tf.`fieldId` = tif.`fieldId`
@@ -4261,10 +4261,12 @@ class TrackerLib extends TikiLib
         foreach ($queryResult as $row) {
             $value = $row['value'];
             $field = [
-                'fieldId' => $row['fieldId'],
-                'trackerId' => $trackerId,
-                'type' => $row['type'],
-                'value' => $value
+                'fieldId'        => $row['fieldId'],
+                'trackerId'      => $trackerId,
+                'type'           => $row['type'],
+                'options'        => $row['options'],
+                'isMultilingual' => $row['isMultilingual'],
+                'value'          => $value
             ];
 
             $handler = $this->get_field_handler($field, $item);



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

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