mirror of
https://github.com/processwire/processwire.git
synced 2025-08-23 23:02:58 +02:00
Make Inputfield requiredLabel customizable per field from API via $inputfield->requiredLabel property, to provide option to override default "missing requird value" label.
This commit is contained in:
@@ -362,7 +362,9 @@ class InputfieldForm extends InputfieldWrapper {
|
||||
if($required) {
|
||||
if($child->isEmpty()) {
|
||||
if(self::debug) $this->debugNote("$child->name - determined that value IS required and is not present (error)");
|
||||
$child->error($this->requiredLabel); // requiredLabel from InputfieldWrapper
|
||||
$requiredLabel = $child->getSetting('requiredLabel');
|
||||
if(empty($requiredLabel)) $requiredLabel = $this->requiredLabel; // requiredLabel from InputfieldWrapper
|
||||
$child->error($requiredLabel);
|
||||
} else {
|
||||
if(self::debug) $this->debugNote("$child->name - determined that value IS required and is populated (good)");
|
||||
}
|
||||
|
Reference in New Issue
Block a user