From ad7c6757ee6180d98b3a3c0074700f74d3c558f6 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Sun, 20 Dec 2015 09:11:02 -0400 Subject: [PATCH] Add validation sinchronization without user --- workflow/engine/classes/class.AppDocumentDrive.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.AppDocumentDrive.php b/workflow/engine/classes/class.AppDocumentDrive.php index 426815209..c00396c98 100644 --- a/workflow/engine/classes/class.AppDocumentDrive.php +++ b/workflow/engine/classes/class.AppDocumentDrive.php @@ -409,7 +409,9 @@ class AppDocumentDrive $emails = $appDoc->getSyncPermissions(); $emails = !empty($emails) ? explode('|', $emails) : array(); + $result = null; foreach ($emails as $index => $email) { + $result = null; if (!empty($email)) { if ($index == 0 && $fields['SYNC_WITH_DRIVE'] == 'UNSYNCHRONIZED') { if ($log) { @@ -451,8 +453,10 @@ class AppDocumentDrive } } - $fields['SYNC_WITH_DRIVE'] = 'SYNCHRONIZED'; - $fields['SYNC_PERMISSIONS'] = null; + if ($result != null) { + $fields['SYNC_WITH_DRIVE'] = 'SYNCHRONIZED'; + $fields['SYNC_PERMISSIONS'] = null; + } } else { $fields['SYNC_WITH_DRIVE'] = 'NO_EXIST_FILE_PM'; if ($log) {