1
0
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:
Ryan Cramer
2018-04-06 06:56:54 -04:00
parent f27feb2bbf
commit c5147a5279
3 changed files with 7 additions and 2 deletions

View File

@@ -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)");
}