1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 15:57:01 +02:00

Update RepeaterPage class for secondary detection of 'forField' when page exists in unexpected location

This commit is contained in:
Ryan Cramer
2020-01-31 11:19:55 -05:00
parent 1c3ba1024f
commit 92ef3bbbc3
2 changed files with 31 additions and 8 deletions

View File

@@ -685,7 +685,10 @@ class PagesEditor extends Wire {
try {
$field->type->savePageField($page, $field);
} catch(\Exception $e) {
$error = sprintf($this->_('Error saving field "%s"'), $name) . ' - ' . $e->getMessage();
$label = $field->getLabel();
$message = $e->getMessage();
if(strpos($message, $label) !== false) $label = $name;
$error = sprintf($this->_('Error saving field "%s"'), $label) . ' — ' . $message;
$this->trackException($e, true, $error);
if($this->wire('database')->inTransaction()) throw $e;
}