- Fixed a backward compat bug
This commit is contained in:
parent
ba74c5a38e
commit
a9613222f8
@ -63,17 +63,17 @@ abstract class Save extends Form implements \Picea\Ui\Method\FormInterface {
|
||||
$this->assignContextToEntity($context);
|
||||
|
||||
if ( $saved = $entity::repository()->save($entity) ) {
|
||||
$context->pushSuccessMessage('lean.api.form.save.success.save');
|
||||
method_exists($context, 'pushSuccessMessage') && $context->pushSuccessMessage('lean.api.form.save.success.save');
|
||||
}
|
||||
else {
|
||||
$context->pushWarningMessage('lean.api.form.save.warning.entity', [ 'entity' => substr($this->entity::class, strrpos($this->entity::class, '\\') + 1) ]);
|
||||
method_exists($context, 'pushWarningMessage') && $context->pushWarningMessage('lean.api.form.save.warning.entity', [ 'entity' => substr($this->entity::class, strrpos($this->entity::class, '\\') + 1) ]);
|
||||
}
|
||||
}
|
||||
catch(\PDOException $ex) {
|
||||
throw new \PDOException($this->lang('lean.api.form.save.error.pdo', [ 'error' => $ex->getMessage() ]));
|
||||
}
|
||||
catch(\Throwable $ex) {
|
||||
$context->pushErrorMessage($ex->getMessage());
|
||||
method_exists($context, 'pushErrorMessage') && $context->pushErrorMessage($ex->getMessage());
|
||||
}
|
||||
|
||||
return $saved ?? false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user