[TikiWiki-commits] [Git][tikiwiki/tiki][master] 2 commits: [FIX] ItemsList: notices when filter field there is not set

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <693d141a9269a_2a17f39016435@gitlab-sidekiq-low-urgency-cpu-bound-v2-64d4768b4d-ds8vb.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
9840fee6 by Victor Emanouilov at 2025-12-13T09:21:53+02:00
[FIX] ItemsList: notices when filter field there is not set

- - - - -
18a75b6f by Victor Emanouilov at 2025-12-13T09:21:53+02:00
[FIX] Manticore: ensure unified field mapping and date field mapping are always set in preferences as __destruct method is not always reliably called

- - - - -


2 changed files:

- lib/core/Search/Manticore/Index.php
- lib/core/Tracker/Field/ItemsList.php


Changes:

=====================================
lib/core/Search/Manticore/Index.php
=====================================
@@ -214,6 +214,19 @@ class Index implements \Search_Index_Interface, \Search_Index_QueryRepository
             $this->updatePercolateIndex($this->index, $pq_mapping);
         }
 
+        if ($mapping) {
+            // store prefs on each index schema update as doing in __destruct is not reliable - various cases omit storing these prefs
+            // and search results are missing fields later
+            $fieldMapping = json_encode($this->fieldMapping);
+            if (empty($prefs['unified_field_mapping']) || $prefs['unified_field_mapping'] != $fieldMapping) {
+                TikiLib::lib('tiki')->set_preference('unified_field_mapping', $fieldMapping);
+            }
+            $dateFields = json_encode($this->dateFields);
+            if (empty($prefs['unified_date_fields']) || $prefs['unified_date_fields'] != $dateFields) {
+                TikiLib::lib('tiki')->set_preference('unified_date_fields', $dateFields);
+            }
+        }
+
         $this->dirty = true;
     }
 


=====================================
lib/core/Tracker/Field/ItemsList.php
=====================================
@@ -777,8 +777,7 @@ $("input[name=ins_' . $this->getOption('fieldIdHere') . '], select[name=ins_' .
                 isset($filterFieldHere['options_array'][0]) &&  // trackerId
                 isset($filterFieldHere['options_array'][1]) &&  // fieldId
                 // check for filterFieldThere not being another ItemLink because then we need the itemId
-                $filterFieldThere['type'] !== 'r' &&
-                $filterFieldThere['type'] !== 'w'
+                (empty($filterFieldThere) || ($filterFieldThere['type'] !== 'r' && $filterFieldThere['type'] !== 'w'))
             ) {
                 $localValue = $trklib->get_item_value(
                     $filterFieldHere['options_array'][0],



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/12e88631d378bd18a08c70ce5caf510daf442284...18a75b6f31f096444674429d06bdb5ec78bdfd9c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/12e88631d378bd18a08c70ce5caf510daf442284...18a75b6f31f096444674429d06bdb5ec78bdfd9c
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.