diff options
author | Marc <dkm@kataplop.net> | 2009-06-10 09:53:00 +0200 |
---|---|---|
committer | Marc <dkm@kataplop.net> | 2009-06-10 09:53:00 +0200 |
commit | 9b4c7ba73cc86dca8fb6cf81a37fbf806e643483 (patch) | |
tree | 0c4d3a99471c21103a34ad5e2fb748199fe4f8f2 /modules/g2_import/helpers/g2_import.php | |
parent | 657e17361db19ac1878b2a6d93595a763aef8b15 (diff) | |
parent | fc64a55f2e6d2e3f16e0806e6672f7d8c8de42a7 (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/g2_import/helpers/g2_import.php')
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 1ff63e36..648f3809 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -414,13 +414,19 @@ class g2_import_Core { Kohana::log("alert", "$g2_path unsupported image type; using a placeholder gif"); $corrupt = 1; } - $item = photo::create( - $parent, - $g2_path, - $g2_item->getPathComponent(), - $g2_item->getTitle(), - self::extract_description($g2_item), - self::map($g2_item->getOwnerId())); + try { + $item = photo::create( + $parent, + $g2_path, + $g2_item->getPathComponent(), + $g2_item->getTitle(), + self::extract_description($g2_item), + self::map($g2_item->getOwnerId())); + } catch (Exception $e) { + Kohana::log("alert", "Corrupt image $g2_path\n" . + $e->getMessage() . "\n" . $e->getTraceAsString()); + $corrupt = 1; + } break; case "GalleryMovieItem": @@ -456,12 +462,18 @@ class g2_import_Core { // Why oh why did I ever approve the session id placeholder idea in G2? $g2_item_url = str_replace('&g2_GALLERYSID=TMP_SESSION_ID_DI_NOISSES_PMT', '', $g2_item_url); - $warning = - t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed; " . - "(imported as <a href=\"%g3_url\">%title</a>)", - array("g2_url" => $g2_item_url, - "g3_url" => $item->url(), - "title" => $g2_item->getTitle())); + if (!empty($item)) { + $warning = + t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed; " . + "(imported as <a href=\"%g3_url\">%title</a>)", + array("g2_url" => $g2_item_url, + "g3_url" => $item->url(), + "title" => $g2_item->getTitle())); + } else { + $warning = + t("<a href=\"%g2_url\">%title</a> from Gallery 2 could not be processed", + array("g2_url" => $g2_item_url, "title" => $g2_item->getTitle())); + } message::warning($warning); log::warning("g2_import", $warning); Kohana::log("alert", $warning); |