[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] trackers: For the mysql engine at least, provided fields cannot be...

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69d5306f915c1_3b19118061577@gitlab-sidekiq-low-urgency-cpu-bound-v2-849f469f87-596b5.mail>

Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
938a2d98 by jonnybradley at 2026-04-07T17:27:14+01:00
[FIX] trackers: For the mysql engine at least, provided fields cannot be optional and need to be declared for all uses.
So for Files fields to work when indexed as geometry data, we must provide the field names for all options.
=> Error: Commit body is empty after tags. (stupid husky rule won't allow a blank line?)
Should fix https://doc.tiki.org/PluginMap when in 30.x

- - - - -


1 changed file:

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


Changes:

=====================================
lib/core/Tracker/Field/Files.php
=====================================
@@ -1105,40 +1105,32 @@ class Tracker_Field_Files extends \Tracker\Field\AbstractItemField implements \T
     public function getProvidedFields(): array
     {
         $baseKey = $this->getBaseKey();
-        if ($this->getOption('indexGeometry') && $this->getValue()) {
-            return ['geo_located', 'geo_file', 'geo_file_format', $baseKey];
-        } else {
-            $fields = [
-                $baseKey,
-                "{$baseKey}_text",
-                "{$baseKey}_names",
-                "{$baseKey}_filenames",
-                "{$baseKey}_filetypes",
-            ];
-            return $fields;
-        }
+        $fields = [
+            $baseKey,
+            "{$baseKey}_text",
+            "{$baseKey}_names",
+            "{$baseKey}_filenames",
+            "{$baseKey}_filetypes",
+            'geo_located',
+            'geo_file',
+            'geo_file_format',
+        ];
+        return $fields;
     }
 
     public function getProvidedFieldTypes(): array
     {
         $baseKey = $this->getBaseKey();
-        if ($this->getOption('indexGeometry') && $this->getValue()) {
-            return [
-                'geo_located' => 'identifier',
-                'geo_file' => 'identifier',
-                'geo_file_format' => 'identifier',
-                $baseKey => 'identifier'
-            ];
-        } else {
-            $baseKey = $this->getBaseKey();
-            return [
-                $baseKey => 'sortable',
-                "{$baseKey}_text" => 'sortable',
-                "{$baseKey}_names" => 'multivalue',
-                "{$baseKey}_filenames" => 'multivalue',
-                "{$baseKey}_filetypes" => 'multivalue',
-            ];
-        }
+        return [
+            $baseKey => 'sortable',
+            "{$baseKey}_text" => 'sortable',
+            "{$baseKey}_names" => 'multivalue',
+            "{$baseKey}_filenames" => 'multivalue',
+            "{$baseKey}_filetypes" => 'multivalue',
+            'geo_located' => 'identifier',
+            'geo_file' => 'identifier',
+            'geo_file_format' => 'identifier',
+        ];
     }
 
     public function getGlobalFields(): array



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

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