Skip to content

Commit

Permalink
Add enhancement processwire/processwire-issues#596 show field labels …
Browse files Browse the repository at this point in the history
…rather than field names in Inputfield error messages
  • Loading branch information
ryancramerdesign committed May 21, 2018
1 parent 2ba8d29 commit 79fa81d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wire/core/Inputfield.php
Expand Up @@ -1458,7 +1458,9 @@ public function error($text, $flags = 0) {
$errors[] = $text;
$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);
}

Expand Down

0 comments on commit 79fa81d

Please sign in to comment.