diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:34:59 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-12 22:34:59 +0000 |
commit | 93ca8e991d246362744bab7ee71aa3bf7fba6660 (patch) | |
tree | f1713abc4654c4bbdac2f27d23d987047e1d1f3b | |
parent | 71defb7d40ebce2a138fabf10533978555886ebc (diff) |
Gracefully handle duplicate groups. Fixes ticket #280
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 7eb7724f..00fa6f47 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -141,7 +141,13 @@ class g2_import_Core { $g2_group = g2(GalleryCoreApi::loadEntitiesById($g2_group_id)); switch ($g2_group->getGroupType()) { case GROUP_NORMAL: - $group = group::create($g2_group->getGroupName()); + try { + $group = group::create($g2_group->getGroupName()); + } catch (Exception $e) { + // @todo For now we assume this is a "duplicate group" exception + $group = group::lookup_by_name($g2_group->getGroupname()); + } + break; case GROUP_ALL_USERS: |