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

Commit

Permalink
Only load the model in the file/page picker if the class exists (see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 16, 2015
1 parent 994f803 commit 903fc0d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions system/docs/CHANGELOG.md
@@ -1,6 +1,13 @@
Contao Open Source CMS changelog
================================

Version 3.4.1 (2015-01-XX)
--------------------------

### Fixed
Only load the model in the file/page picker if the class exists (see #7490).


Version 3.4.0 (2014-11-25)
--------------------------

Expand Down
10 changes: 7 additions & 3 deletions system/modules/core/controllers/BackendFile.php
Expand Up @@ -84,11 +84,15 @@ public function run()
if ($this->Database->tableExists($strTable))
{
$strModel = \Model::getClassFromTable($strTable);
$objModel = $strModel::findByPk(\Input::get('id'));

if ($objModel !== null)
if (class_exists($strModel))
{
$objDca->activeRecord = $objModel;
$objModel = $strModel::findByPk(\Input::get('id'));

if ($objModel !== null)
{
$objDca->activeRecord = $objModel;
}
}
}

Expand Down
10 changes: 7 additions & 3 deletions system/modules/core/controllers/BackendPage.php
Expand Up @@ -84,11 +84,15 @@ public function run()
if ($this->Database->tableExists($strTable))
{
$strModel = \Model::getClassFromTable($strTable);
$objModel = $strModel::findByPk(\Input::get('id'));

if ($objModel !== null)
if (class_exists($strModel))
{
$objDca->activeRecord = $objModel;
$objModel = $strModel::findByPk(\Input::get('id'));

if ($objModel !== null)
{
$objDca->activeRecord = $objModel;
}
}
}

Expand Down

0 comments on commit 903fc0d

Please sign in to comment.