[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] trackers: Exclude AutoIncrement and GeographicFeature type fields from...

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6995f59edb42a_3b186b0454945@gitlab-sidekiq-low-urgency-cpu-bound-v2-68c86796b8-qljj7.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
05c078e9 by Jonny Bradley at 2026-02-18T17:23:29+00:00
[FIX] trackers: Exclude AutoIncrement and GeographicFeature type fields from...
---
* [FIX] trackers: Exclude AutoIncrement and GeographicFeature type fields from mandatory validation as they don't have a value in the default edit form (as seen on Cartograf upgrades)

See merge request tikiwiki/tiki!9600


(cherry picked from commit 2c84c5a4262c6e19d332135a590cc5638830284a)

e31e6813 [FIX] trackers: Exclude AutoIncrement and GeographicFeature type fields from...

Co-authored-by: Jonny Bradley <[email protected]>

(cherry picked from commit 4ff85426c14be6594774c512141e02c072c5f8d6)

Co-authored-by: Jonny Bradley <[email protected]>
- - - - -


2 changed files:

- lib/trackers/trackerlib.php
- lib/validatorslib.php


Changes:

=====================================
lib/trackers/trackerlib.php
=====================================
@@ -2995,7 +2995,8 @@ class TrackerLib extends TikiLib
                     $f['errorMsg'] = tra('Confirmation %0 do not match', $f['name']);
                     $erroneous_values[] = $f;
                 }
-                if ($f['type'] != 'q' and isset($f['isMandatory']) && $f['isMandatory'] == 'y') {
+                // exclude AutoIncrement and GeographicFeature type fields as they are read-only in the default edit form
+                if (! in_array($f['type'], ['q', 'GF']) && isset($f['isMandatory']) && $f['isMandatory'] == 'y') {
                     if (($f['type'] == 'e' || in_array($f['fieldId'], $categorized_fields)) && empty($f['value'])) {    // category: value is now categ id's
                         $mandatory_fields[] = $f;
                     } elseif (in_array($f['type'], ['a', 't']) && ($this->is_multilingual($f['fieldId']) == 'y')) {


=====================================
lib/validatorslib.php
=====================================
@@ -94,7 +94,8 @@ class Validators
                             $validationjs .= $prefix . $field_value['fieldId'] . 'Hour: {required_in_group: [' . $date_ins_num . ', "select[name^=' . $prefix . $field_value['fieldId'] . ']"]}, ' .
                                 $prefix . $field_value['fieldId'] . 'Minute: {required_in_group: [' . $date_ins_num . ', "select[name^=' . $prefix . $field_value['fieldId'] . ']"], ';
                         }
-                    } else {
+                    } elseif (! in_array($field_value['type'], ['q', 'GF'])) {
+                        // exclude AutoIncrement and GeographicFeature type fields as they are read-only in the default edit form
                         if ($field_value['isMultilingual'] == 'y') {
                             $required_script = "required: function(e) { ";
                             $condition = "";



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

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