From 2b76ffa1c047e6de925f0242e6eedaffd5178754 Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Fri, 3 Oct 2014 14:58:26 +0200 Subject: [PATCH] Check the table existence in the page and file picker (see #7346) --- system/modules/core/controllers/BackendFile.php | 13 ++++++++----- system/modules/core/controllers/BackendPage.php | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/system/modules/core/controllers/BackendFile.php b/system/modules/core/controllers/BackendFile.php index 36cb07d159..9df4f1beff 100644 --- a/system/modules/core/controllers/BackendFile.php +++ b/system/modules/core/controllers/BackendFile.php @@ -81,12 +81,15 @@ public function run() $objDca->field = $strField; // Set the active record - $strModel = \Model::getClassFromTable($strTable); - $objModel = $strModel::findByPk(\Input::get('id')); - - if ($objModel !== null) + if ($this->Database->tableExists($strTable)) { - $objDca->activeRecord = $objModel; + $strModel = \Model::getClassFromTable($strTable); + $objModel = $strModel::findByPk(\Input::get('id')); + + if ($objModel !== null) + { + $objDca->activeRecord = $objModel; + } } // AJAX request diff --git a/system/modules/core/controllers/BackendPage.php b/system/modules/core/controllers/BackendPage.php index 6cb4c1ca6a..3323ea7b77 100644 --- a/system/modules/core/controllers/BackendPage.php +++ b/system/modules/core/controllers/BackendPage.php @@ -81,12 +81,15 @@ public function run() $objDca->field = $strField; // Set the active record - $strModel = \Model::getClassFromTable($strTable); - $objModel = $strModel::findByPk(\Input::get('id')); - - if ($objModel !== null) + if ($this->Database->tableExists($strTable)) { - $objDca->activeRecord = $objModel; + $strModel = \Model::getClassFromTable($strTable); + $objModel = $strModel::findByPk(\Input::get('id')); + + if ($objModel !== null) + { + $objDca->activeRecord = $objModel; + } } // AJAX request