Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Check the table existence in the page and file picker (see #7346)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Oct 3, 2014
1 parent 9c272cc commit 2b76ffa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions system/modules/core/controllers/BackendFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions system/modules/core/controllers/BackendPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b76ffa

Please sign in to comment.