[TikiWiki-commits] [Git][tikiwiki/tiki][26.x] [FIX] API and tracker item save: ability to skip validation when API has...

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

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


Commits:
f666a21a by Victor Emanouilov at 2025-10-02T12:32:52+03:00
[FIX] API and tracker item save: ability to skip validation when API has nothing to do with mandatory fields, for example

- - - - -


1 changed file:

- lib/core/Services/Tracker/Controller.php


Changes:

=====================================
lib/core/Services/Tracker/Controller.php
=====================================
@@ -1044,13 +1044,20 @@ class Services_Tracker_Controller
 
             $deletedFiles = $itemObject->deletedFiles($input);
 
+            if (TIKI_API) {
+                $validate = ! $input->skipValidation->bool();
+            } else {
+                $validate = true;
+            }
+
             $itemId = $this->utilities->insertItem(
                 $definition,
                 [
                     'status' => $input->status->word(),
                     'fields' => $fields,
                     'processedFields' => $processedFields,
-                    'deletedFiles' => $deletedFiles
+                    'deletedFiles' => $deletedFiles,
+                    'validate' => $validate,
                 ]
             );
 
@@ -1305,6 +1312,12 @@ class Services_Tracker_Controller
 
             $deletedFiles = $itemObject->deletedFiles($input);
 
+            if (TIKI_API) {
+                $validate = ! $input->skipValidation->bool();
+            } else {
+                $validate = true;
+            }
+
             $result = $this->utilities->updateItem(
                 $definition,
                 [
@@ -1312,7 +1325,8 @@ class Services_Tracker_Controller
                     'status' => $input->status->word(),
                     'fields' => $fields,
                     'processedFields' => $processedFields,
-                    'deletedFiles' => $deletedFiles
+                    'deletedFiles' => $deletedFiles,
+                    'validate' => $validate,
                 ]
             );
 



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

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