[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] Revert "[BP][FIX] Trackers: Prevent client-side validation on mandatory auto-increment fields"
"Sammy Ndabo \(@ndabosam084\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <693d77e6113a6_2a136951053780@gitlab-sidekiq-low-urgency-cpu-bound-v2-64d4768b4d-kczcd.mail> |
Sammy Ndabo pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
b997c336 by Sammy Ndabo at 2025-12-13T14:21:33+00:00
Revert "[BP][FIX] Trackers: Prevent client-side validation on mandatory auto-increment fields"
---
* Revert "[BP][FIX] Trackers: Prevent client-side validation on mandatory auto-increment fields"
This reverts merge request !9229
See merge request tikiwiki/tiki!9230
- - - - -
3 changed files:
- lib/core/Tracker/Field/AbstractItemField.php
- lib/core/Tracker/Field/AutoIncrement.php
- lib/validatorslib.php
Changes:
=====================================
lib/core/Tracker/Field/AbstractItemField.php
=====================================
@@ -676,16 +676,4 @@ abstract class AbstractItemField implements ItemFieldInterface, IndexableInterfa
{
return '';
}
- /**
- * Determines if a field, when marked as mandatory, should be validated
- * on the client-side (in browser JavaScript).
- *
- * @return bool True if client-side validation should apply, false otherwise.
- */
- public function isClientSideMandatory(): bool
- {
- // By default, all mandatory fields are validated on the client side.
- // Specific field types can override this behavior.
- return true;
- }
}
=====================================
lib/core/Tracker/Field/AutoIncrement.php
=====================================
@@ -137,18 +137,6 @@ class Tracker_Field_AutoIncrement extends \Tracker\Field\AbstractItemField imple
];
}
- /**
- * Overrides the default client-side validation behavior.
- * An auto-increment field's value is generated on the server, so it should
- * never be considered mandatory by client-side JavaScript validation.
- *
- * @return bool Always returns false.
- */
- public function isClientSideMandatory(): bool
- {
- return false;
- }
-
public function getTabularSchema()
{
$schema = new Tracker\Tabular\Schema($this->getTrackerDefinition());
=====================================
lib/validatorslib.php
=====================================
@@ -76,7 +76,7 @@ class Validators
$validationjs .= $prefix . $field_value['fieldId'] . ': { ';
}
}
- if ($isMandatory && $handler->isClientSideMandatory()) {
+ if ($isMandatory) {
if ($field_value['type'] == 'D') {
$validationjs .= 'required_in_group: [1, ".group_' . $prefix . $field_value['fieldId'] . '", "other"], ';
} elseif ($field_value['type'] == 'A') {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b997c33623c94a82a7bd755ed2545d127073cba5
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b997c33623c94a82a7bd755ed2545d127073cba5
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