mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Fix issue processwire/processwire-issues#1326
This commit is contained in:
@@ -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;
|
||||
|
@@ -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() . ")";
|
||||
|
Reference in New Issue
Block a user