[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <6995f53659de6_3c186adc6281@gitlab-sidekiq-low-urgency-cpu-bound-v2-68c86796b8-pn7ql.mail>

Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
2c84c5a4 by Jonny Bradley at 2026-02-18T17:12:23+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

- - - - -


2 changed files:

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


Changes:

=====================================
lib/trackers/trackerlib.php
=====================================
@@ -2962,7 +2962,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
=====================================
@@ -103,7 +103,8 @@ class Validators
                             $validationjs .= $field_name . 'Hour: {required_in_group: [' . $date_ins_num . ', "select[name^=\'' . $field_name . '\']"]}, ' .
                                 $field_name . 'Minute: {required_in_group: [' . $date_ins_num . ', "select[name^=\'' . $field_name . '\']"], ';
                         }
-                    } 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/2c84c5a4262c6e19d332135a590cc5638830284a

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