mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 03:34:33 +02:00
Update ProcessPageEdit so that it detects when the same error message might get shown twice and prevents it from happening
This commit is contained in:
@@ -2068,7 +2068,14 @@ class ProcessPageEdit extends Process implements WirePageEditor, ConfigurableMod
|
||||
}
|
||||
|
||||
} catch(\Exception $e) {
|
||||
$this->error($e->getMessage());
|
||||
$show = true;
|
||||
$message = $e->getMessage();
|
||||
foreach($this->errors('all') as $error) {
|
||||
if(strpos($error, $message) === false) continue;
|
||||
$show = false;
|
||||
break;
|
||||
}
|
||||
if($show) $this->error($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user