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

"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a3cf7dc217f2_3841b73e01016c2@gitlab-sidekiq-low-urgency-cpu-bound-v2-d68649794-xm9wb.mail>

MAGENE Sem Joel pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
19ddac0b by Landry Bitege at 2026-06-25T09:36:01+00:00
[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

- - - - -


2 changed files:

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


Changes:

=====================================
lib/core/Tracker/Field/Text.php
=====================================
@@ -175,6 +175,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
=====================================
@@ -4166,7 +4166,7 @@ class TrackerLib extends TikiLib
                 return $cache[$cacheKey];
             }
         }
-        $query = "SELECT tif.`value`, tf.`type`, tf.`fieldId`, tf.`options`, 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`
@@ -4184,11 +4184,12 @@ class TrackerLib extends TikiLib
         foreach ($queryResult as $row) {
             $value = $row['value'];
             $field = [
-                'fieldId' => $row['fieldId'],
-                'trackerId' => $trackerId,
-                'type' => $row['type'],
-                'options' => $row['options'],
-                '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/19ddac0bcfe477f1ef464075f1583c99ccac29b2

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