1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 08:17:12 +02:00
This commit is contained in:
Ryan Cramer
2021-03-19 11:40:07 -04:00
parent 3146b5c6c8
commit d0b404b752
2 changed files with 2 additions and 2 deletions

View File

@@ -1308,7 +1308,7 @@ abstract class Fieldtype extends WireData implements Module {
} catch(\PDOException $e) {
if($e->getCode() == 23000) {
$message = sprintf($this->_('Value not allowed for field “%2$s” because it is already in use'), $field->name);
$message = sprintf($this->_('Value not allowed for field “%s” because it is already in use'), $field->name);
throw new WireDatabaseException($message, $e->getCode(), $e);
} else {
throw $e;

View File

@@ -1365,7 +1365,7 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable {
if($text !== null) {
if($text === true) $text = $msg;
$severe ? $this->error($text) : $this->warning($text);
if(strpos($text, $msg) === false) $msg = "$text - $msg";
if(strlen($msg) && strpos($text, $msg) === false) $msg = "$text - $msg";
}
if(in_array('exceptions', $config->logs) && $log) {
$msg .= " (in " . str_replace($config->paths->root, '/', $e->getFile()) . " line " . $e->getLine() . ")";