summaryrefslogtreecommitdiff
path: root/modules/g2_import
diff options
context:
space:
mode:
Diffstat (limited to 'modules/g2_import')
-rw-r--r--modules/g2_import/controllers/admin_g2_import.php2
-rw-r--r--modules/g2_import/controllers/g2.php2
-rw-r--r--modules/g2_import/helpers/g2_import.php23
-rw-r--r--modules/g2_import/helpers/g2_import_event.php2
-rw-r--r--modules/g2_import/helpers/g2_import_installer.php2
-rw-r--r--modules/g2_import/helpers/g2_import_task.php2
-rw-r--r--modules/g2_import/helpers/g2_import_theme.php2
-rw-r--r--modules/g2_import/models/g2_map.php2
8 files changed, 23 insertions, 14 deletions
diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php
index f216091a..bc00378d 100644
--- a/modules/g2_import/controllers/admin_g2_import.php
+++ b/modules/g2_import/controllers/admin_g2_import.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php
index 1d97653a..2c6ad1b4 100644
--- a/modules/g2_import/controllers/g2.php
+++ b/modules/g2_import/controllers/g2.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 6240403d..9c20ec4d 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -414,7 +414,12 @@ class g2_import_Core {
$album->title or $album->title = $album->name;
$album->description = self::_decode_html_special_chars(self::extract_description($g2_album));
$album->owner_id = self::map($g2_album->getOwnerId());
- $album->view_count = g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ try {
+ $album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ } catch (Exception $e) {
+ // @todo log
+ $album->view_count = 0;
+ }
$album->created = $g2_album->getCreationTimestamp();
$order_map = array(
@@ -490,7 +495,11 @@ class g2_import_Core {
$g3_album = ORM::factory("item", $g3_album_id);
$g3_album->album_cover_item_id = $item->id;
$g3_album->thumb_dirty = 1;
- $g3_album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ try {
+ $g3_album->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_album_id));
+ } catch (Exception $e) {
+ $g3_album->view_count = 0;
+ }
try {
$g3_album->save();
graphics::generate($g2_album);
@@ -614,11 +623,11 @@ class g2_import_Core {
$g2_item_url = self::g2_url(array("view" => "core.ShowItem", "itemId" => $g2_item->getId()));
if (isset($item)) {
- $view_count = g2(GalleryCoreApi::fetchItemViewCount($g2_item_id));
- if (!is_numeric($view_count)) {
- $messages[] = t("Bad view count value '%view_count'", array("view_count" => $view_count));
+ try {
+ $item->view_count = (int) g2(GalleryCoreApi::fetchItemViewCount($g2_item_id));
+ } catch (Exception $e) {
+ $view_count = 1;
}
- $item->view_count = (int) $view_count;
$item->save();
self::set_map($g2_item_id, $item->id, "item", $g2_item_url);
diff --git a/modules/g2_import/helpers/g2_import_event.php b/modules/g2_import/helpers/g2_import_event.php
index 02a2126d..d3eb001a 100644
--- a/modules/g2_import/helpers/g2_import_event.php
+++ b/modules/g2_import/helpers/g2_import_event.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php
index 1ec8afa9..8ada4fcb 100644
--- a/modules/g2_import/helpers/g2_import_installer.php
+++ b/modules/g2_import/helpers/g2_import_installer.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php
index b1179e22..f2a13291 100644
--- a/modules/g2_import/helpers/g2_import_task.php
+++ b/modules/g2_import/helpers/g2_import_task.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/helpers/g2_import_theme.php b/modules/g2_import/helpers/g2_import_theme.php
index b1aaac00..788253f9 100644
--- a/modules/g2_import/helpers/g2_import_theme.php
+++ b/modules/g2_import/helpers/g2_import_theme.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/modules/g2_import/models/g2_map.php b/modules/g2_import/models/g2_map.php
index 12fc1565..a20f48d6 100644
--- a/modules/g2_import/models/g2_map.php
+++ b/modules/g2_import/models/g2_map.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2009 Bharat Mediratta
+ * Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by