[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] 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 <693d142b5c69d_2b17f3cc45d1@gitlab-sidekiq-low-urgency-cpu-bound-v2-64d4768b4d-rxv7s.mail>

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


Commits:
e9cec52c by Victor Emanouilov at 2025-12-13T09:22:07+02:00
[FIX] ItemsList: notices when filter field there is not set

- - - - -
147b3745 by Victor Emanouilov at 2025-12-13T09:22:13+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/7b34765ba951b8ad35e5ca39336a8a0ddde257cc...147b3745fe0324e9ea931e51942f90af92e4d0f3

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/compare/7b34765ba951b8ad35e5ca39336a8a0ddde257cc...147b3745fe0324e9ea931e51942f90af92e4d0f3
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.