[TikiWiki-commits] [Git][tikiwiki/tiki][tiki-fix-tracker-url-wikisyntax] [FIX] URL field: normalize wiki-link values to resolved href in CSV output

"Sammy Ndabo \(@ndabosam084\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6993aed998456_3b1864744702c@gitlab-sidekiq-low-urgency-cpu-bound-v2-5cb68884d8-hzgwk.mail>

Sammy Ndabo pushed to branch tiki-fix-tracker-url-wikisyntax at Tiki Wiki CMS Groupware / Tiki


Commits:
bd28c6d0 by Sammy Ndabo at 2026-02-17T01:56:51+02:00
[FIX] URL field: normalize wiki-link values to resolved href in CSV output

- - - - -


1 changed file:

- lib/core/Tracker/Field/Url.php


Changes:

=====================================
lib/core/Tracker/Field/Url.php
=====================================
@@ -74,12 +74,27 @@ class Tracker_Field_Url extends \Tracker\Field\AbstractItemField implements \Tra
     {
         $smarty = TikiLib::lib('smarty');
 
-        $url = $this->getConfiguration('value');
+        $url = (string) $this->getConfiguration('value');
         $trimmed = trim($url);
+        $isCsv = (($context['list_mode'] ?? '') === 'csv');
+        $isPlainTextMode = ((int) $this->getOption('linkToURL') === 1);
+        $isWikiWrapped = self::isWikiSyntaxLink($trimmed);
 
-        if (empty($url) || $context['list_mode'] == 'csv' || $this->getOption('linkToURL') == 1) {
+        if ($url === '') return $url;
+
+        if ($isCsv) {
+            if ($isWikiWrapped) {
+                $resolvedHref = self::extractFirstHrefFromParsedWikiLink($trimmed);
+                if ($resolvedHref !== null) {
+                    return $resolvedHref;
+                }
+            }
+            return $url;
+        }
+
+        if ($isPlainTextMode) {
             return $url;
-        } elseif (self::isWikiSyntaxLink($trimmed)) {
+        } elseif ($isWikiWrapped) {
             // Intentionally limited wiki-syntax detection for URL fields.
             // Supports only full-value wrappers like ((PageName)) or [url|text].
             // TODO: For full wiki parsing consistency (escaping, multilingual behavior, shared parsing path),



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bd28c6d0bbdfe8de1a974f6a43a780c7268ff22c
You're receiving this email because of your account on gitlab.com.

_______________________________________________
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.