[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Cypht integration: fix move to tracker search and item suggestion, send...

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68d3fbe454798_2c30a816c3176e@gitlab-sidekiq-low-urgency-cpu-bound-v2-69d75bf97c-vxbk5.mail>

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


Commits:
a9d1d014 by Victor Emanouilov at 2025-09-24T17:10:23+03:00
[FIX] Cypht integration: fix move to tracker search and item suggestion, send Tiki feedback via cypht ajax calls and handle it on the client side

- - - - -


8 changed files:

- lib/core/Services/Cypht/Controller.php
- lib/cypht/modules/tiki/functions.php
- lib/cypht/modules/tiki/general_modules.php
- lib/cypht/modules/tiki/js_modules/moveToTracker.js
- lib/cypht/modules/tiki/js_modules/utils/moveToTrackerSearch.utils.js
- lib/cypht/modules/tiki/setup.php
- lib/cypht/modules/tiki/site.js
- vendor_bundled/composer.lock


Changes:

=====================================
lib/core/Services/Cypht/Controller.php
=====================================
@@ -35,6 +35,8 @@ class Services_Cypht_Controller
             }
         }
 
+        Feedback::sendHeaders();
+
         // either html or already json encoded, so skip broker/accesslib output and do it here
         echo $dispatcher->session->dedup_page_links($dispatcher->output);
         exit;


=====================================
lib/cypht/modules/tiki/functions.php
=====================================
@@ -458,7 +458,7 @@ if (! hm_exists('append_to_msg_headers')) {
     }
 }
 
-function find_relevant_tracker_items($keywords, $multivalueField = '', $searchArgs = [], $avoidSubQueries = false)
+function find_relevant_tracker_items($keywords, $multivalueField = '', $searchArgs = [])
 {
     global $prefs;
 
@@ -493,14 +493,7 @@ function find_relevant_tracker_items($keywords, $multivalueField = '', $searchAr
         }, $fields));
         $query->filterMultivalue($filterField, $keywords);
     } else {
-        if ($avoidSubQueries) {
-            $query->filterContent($keywords);
-        } else {
-            $subq = $query->getSubQuery('keywords');
-            foreach (explode(' ', $keywords) as $keyword) {
-                $subq->filterContent($keyword);
-            }
-        }
+        $query->filterContent($keywords);
     }
 
     $resultSet = $query->search($lib->getIndex());


=====================================
lib/cypht/modules/tiki/general_modules.php
=====================================
@@ -494,7 +494,7 @@ class Hm_Handler_get_msg_tracker_items extends Hm_Handler_Module
             if (isset($this->request->post['tracker_id'])) {
                 $searchArgs['field_id'] = $this->request->post['field_id'];
             }
-            $this->out('tracker_items', find_relevant_tracker_items($this->request->post['lookup'], searchArgs: $searchArgs, avoidSubQueries: $this->request->post['is_manual_search'] ?? false));
+            $this->out('tracker_items', find_relevant_tracker_items($this->request->post['lookup'], searchArgs: $searchArgs));
             return;
         }
 


=====================================
lib/cypht/modules/tiki/js_modules/moveToTracker.js
=====================================
@@ -17,7 +17,7 @@ function showMoveToTrackerModal(onSuccess) {
 
             Hm_Ajax.request([
                 {name: 'hm_ajax_hook', value: 'ajax_tiki_msg_tracker_items'},
-                {name: 'lookup', value: $('.js-header_subject').text().replace(/[^\w\s]/g, '')},
+                {name: 'lookup', value: $('.js-header_subject').text().replace(/[^\w\s\.]/g, '')},
                 {name: 'limit', value: 5},
                 {name: 'sort_mode', value: 'score_desc'},
             ], (res) => {


=====================================
lib/cypht/modules/tiki/js_modules/utils/moveToTrackerSearch.utils.js
=====================================
@@ -37,7 +37,6 @@ function moveToTrackerItemSearchHandler(onSuccess) {
             Hm_Ajax.request([
                 {name: 'hm_ajax_hook', value: 'ajax_tiki_msg_tracker_items'},
                 {name: 'lookup', value: keyword},
-                {name: 'is_manual_search', value: true},
                 {name: 'tracker_id', value: tracker_id},
                 {name: 'field_id', value: field_id},
                 {name: 'limit', value: 100},


=====================================
lib/cypht/modules/tiki/setup.php
=====================================
@@ -320,8 +320,9 @@ return [
     'lookup' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
     'tracker_id' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
     'field_id' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
+    'sort_mode' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
+    'limit' => FILTER_VALIDATE_INT,
     'in_reply_to' => FILTER_SANITIZE_FULL_SPECIAL_CHARS,
     'auto_move' => FILTER_VALIDATE_BOOLEAN,
-    'is_manual_search' => FILTER_VALIDATE_BOOLEAN,
   ]
 ];


=====================================
lib/cypht/modules/tiki/site.js
=====================================
@@ -845,6 +845,9 @@ $(function() {
 
     cleanUpFooter();
     Hm_Ajax.add_callback_hook('ajax_hm_folders', cleanUpFooter);
+    Hm_Ajax.add_callback_hook('*', function(res, xhr) {
+        $(document).trigger('ajaxComplete', xhr);
+    });
 
     $('.folder_list .search_terms').off('search');
     $('.folder_list .search_terms').on('search', function(e) {


=====================================
vendor_bundled/composer.lock
=====================================
@@ -2862,12 +2862,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/cypht-org/cypht.git",
-                "reference": "00593ecc63a260f3e7081c6c4e95039e6fb18982"
+                "reference": "49d6f048b2dc5758853cb4d548edc5b39645d4ea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/00593ecc63a260f3e7081c6c4e95039e6fb18982",
-                "reference": "00593ecc63a260f3e7081c6c4e95039e6fb18982",
+                "url": "https://api.github.com/repos/cypht-org/cypht/zipball/49d6f048b2dc5758853cb4d548edc5b39645d4ea",
+                "reference": "49d6f048b2dc5758853cb4d548edc5b39645d4ea",
                 "shasum": ""
             },
             "require": {
@@ -2943,7 +2943,7 @@
                 "source": "https://github.com/cypht-org/cypht/",
                 "wiki": "https://github.com/cypht-org/cypht/wiki"
             },
-            "time": "2025-09-15T06:35:12+00:00"
+            "time": "2025-09-24T14:08:35+00:00"
         },
         {
             "name": "jean85/pretty-package-versions",



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

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