Validate custom skins and languages.
This commit is contained in:
davidcallizaya
2017-06-04 12:42:15 -04:00
parent 84ea1c0caf
commit ab82f369e6

View File

@@ -280,6 +280,18 @@ class WebEntryEvent
$this->arrayFieldDefinition['WE_LINK_SKIN']['empty'] = false; $this->arrayFieldDefinition['WE_LINK_SKIN']['empty'] = false;
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['empty'] = false; $this->arrayFieldDefinition['WE_LINK_LANGUAGE']['empty'] = false;
$this->arrayFieldDefinition['WE_LINK_DOMAIN']['empty'] = false; $this->arrayFieldDefinition['WE_LINK_DOMAIN']['empty'] = false;
$modelSkins = new \ProcessMaker\BusinessModel\Skins();
$skins = [];
foreach ($modelSkins->getSkins() as $mSkin) {
$skins[] = $mSkin['SKIN_FOLDER_ID'];
}
$this->arrayFieldDefinition['WE_LINK_SKIN']['defaultValues'] = $skins;
$modelLanguages = new \ProcessMaker\BusinessModel\Language();
$languages = [];
foreach ($modelLanguages->getLanguageList() as $mLang) {
$languages[] = $mLang['LANG_ID'];
}
$this->arrayFieldDefinition['WE_LINK_LANGUAGE']['defaultValues'] = $languages;
} }
$process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, $flagInsert); $process->throwExceptionIfDataNotMetFieldDefinition($arrayData, $this->arrayFieldDefinition, $this->arrayFieldNameForException, $flagInsert);