Merged in zeitmaster/processmaker/MT-10 (pull request #4039)

MT-85
This commit is contained in:
Gustavo Cruz
2016-04-02 11:06:22 -04:00
2 changed files with 6 additions and 9 deletions

View File

@@ -182,16 +182,13 @@ class GranularImporter
* @return bool
* @throws \Exception
*/
public function validateImportData($objectList, $generateUid = false)
public function validateImportData($objectList)
{
try {
if ($generateUid) {
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
$exception = new ImportException();
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
throw($exception);
}
if (count($objectList) !== count($this->exportObjects->getObjectsList())) {
$exception = new ImportException();
$exception->setNameException(\G::LoadTranslation('ID_PROCESS_DEFINITION_INCOMPLETE'));
throw($exception);
}
return true;
} catch (\Exception $e) {

View File

@@ -234,7 +234,7 @@ abstract class Importer
$granularObj = new \ProcessMaker\BusinessModel\Migrator\GranularImporter();
$newObjectArray = $objectsToImport;
$projectUid = $this->importData['tables']['bpmn']["project"][0]["prj_uid"];
$processGranulate = $granularObj->validateImportData($objectsToImport, $generateUid);
$processGranulate = $granularObj->validateImportData($objectsToImport);
if($generateUid){
$result = $granularObj->regenerateAllUids($this->importData, $generateUid);
$this->importData = $result['data'];