diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-15 03:43:06 +0800 |
---|---|---|
committer | <unostar@danalan.info> | 2009-06-15 17:31:15 +0800 |
commit | 2ecb00c492c1312e7214c5bb1c2d256225cf2c73 (patch) | |
tree | f3150c90fa92bec5b7c03444cda019229c538827 | |
parent | 08a5b753453057dedb4c8d25bd68264f92ac0fb8 (diff) |
Trap gallery2 errors when we try to load an invalid user id and abort loading that user.
Signed-off-by: <unostar@danalan.info>
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 33cfc158..30ddda50 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -253,7 +253,14 @@ class g2_import_Core { $g2_admin_group_id = g2(GalleryCoreApi::getPluginParameter("module", "core", "id.adminGroup")); - $g2_user = g2(GalleryCoreApi::loadEntitiesById($g2_user_id)); + try { + $g2_user = g2(GalleryCoreApi::loadEntitiesById($g2_user_id)); + } catch (Exception $e) { + $msg = t("Failed to import Gallery 2 user with id: %id", array("id" => $g2_user_id)); + Kohana::log("alert", $msg); + message::warning($msg); + return; + } $g2_groups = g2(GalleryCoreApi::fetchGroupsForUser($g2_user->getId())); try { |