Fixed issues when adding/removing modules during the setup:

- When adding modules: the data model was not refreshed in the cache before attempting to load "structure" (or "sample") data
- When removing a module: remaining (invalid) triggers were still used.

SVN:trunk[1401]
This commit is contained in:
Denis Flaven
2011-08-01 10:30:22 +00:00
parent 05338caa23
commit aa6d7578d1
3 changed files with 7 additions and 36 deletions

View File

@@ -1203,13 +1203,11 @@ abstract class DBObject
// Activate any existing trigger
$sClass = get_class($this);
$oSet = new DBObjectSet(new DBObjectSearch('TriggerOnObjectCreate'));
$sClassList = implode("', '", MetaModel::EnumParentClasses($sClass, ENUM_PARENT_CLASSES_ALL));
$oSet = new DBObjectSet(DBObjectSearch::FromOQL("SELECT TriggerOnObjectCreate AS t WHERE t.target_class IN ('$sClassList')"));
while ($oTrigger = $oSet->Fetch())
{
if (MetaModel::IsParentClass($oTrigger->Get('target_class'), $sClass))
{
$oTrigger->DoActivate($this->ToArgs('this'));
}
$oTrigger->DoActivate($this->ToArgs('this'));
}
return $this->m_iKey;