mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 19:24:28 +02:00
Add enhancement processwire/processwire-issues#596 show field labels rather than field names in Inputfield error messages
This commit is contained in:
@@ -1458,7 +1458,9 @@ abstract class Inputfield extends WireData implements Module {
|
|||||||
$errors[] = $text;
|
$errors[] = $text;
|
||||||
$this->wire('session')->set($key, $errors);
|
$this->wire('session')->set($key, $errors);
|
||||||
}
|
}
|
||||||
$text .= $this->name ? " ($this->name)" : "";
|
$label = $this->getSetting('label');
|
||||||
|
if(empty($label)) $label= $this->attr('name');
|
||||||
|
if(strlen($label)) $text .= " - $label";
|
||||||
return parent::error($text, $flags);
|
return parent::error($text, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user