From 321f7eaa1f1a49cae80fda152d111f329f25dbcc Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sun, 29 Dec 2019 15:40:28 +1100 Subject: [PATCH] Catch fatal errors after cycling page action This is a complex issues where a "model not found" exception is getting thrown during the `pageAction` cycle, then getting suppressed by the fatal error handler: try { // RelationController throws error here } catch (Exception $ex) { $this->controller->handleError($ex); } Fixes #4784 --- modules/backend/behaviors/RelationController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 4f72e224d..20b55decc 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -290,6 +290,10 @@ class RelationController extends ControllerBehavior } $this->controller->pageAction(); + if ($fatalError = $this->controller->getFatalError()) { + throw new ApplicationException($fatalError); + } + $this->validateField(); $this->prepareVars(); $this->initialized = true;