Archives: refactoring of the API to enable/disable the archive mode

SVN:trunk[4696]
This commit is contained in:
Romain Quetiez
2017-04-26 15:48:24 +00:00
parent a55245d203
commit e3931274ae
8 changed files with 43 additions and 40 deletions

View File

@@ -379,7 +379,7 @@ try
$oP->set_title(Dict::S('UI:ErrorPageTitle'));
// Attempt to load the object in archive mode
DBSearch::SetArchiveModeDefault(true);
utils::PushArchiveMode(true);
if (is_numeric($id))
{
$oObj = MetaModel::GetObject($sClass, $id, false /* MustBeFound */);
@@ -388,6 +388,7 @@ try
{
$oObj = MetaModel::GetObjectByName($sClass, $id, false /* MustBeFound */);
}
utils::PopArchiveMode();
if (is_null($oObj))
{
$oP->P(Dict::S('UI:ObjectDoesNotExist'));