[TikiWiki-commits] [Git][tikiwiki/tiki][29.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 <68de4c516a621_2cdeee0973e3@gitlab-sidekiq-low-urgency-cpu-bound-v2-575c7fdb85-b5x9j.mail>

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


Commits:
3fa0c975 by Victor Emanouilov at 2025-10-02T12:56:28+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
=====================================
@@ -1101,13 +1101,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,
                 ]
             );
 
@@ -1370,6 +1377,12 @@ class Services_Tracker_Controller
 
             $deletedFiles = $itemObject->deletedFiles($input);
 
+            if (TIKI_API) {
+                $validate = ! $input->skipValidation->bool();
+            } else {
+                $validate = true;
+            }
+
             $result = $this->utilities->updateItem(
                 $definition,
                 [
@@ -1377,7 +1390,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/3fa0c975466a16ff869064fc7fc3b34b7f83f9d3

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