From b2afba1db1184fcf491bbdf7f0a50ddb5615e26f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 14 Jun 2010 21:20:33 -0700 Subject: The fact that we have a path to a G2 embed file doesn't mean that it's still valid so check to see that it's ok before proceeding. This should resolve #458. --- modules/g2_import/controllers/admin_g2_import.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/g2_import') diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index b1018560..cc60f757 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -33,7 +33,7 @@ class Admin_g2_import_Controller extends Admin_Controller { $view->page_title = t("Gallery 2 import"); $view->content = new View("admin_g2_import.html"); $view->content->form = $this->_get_import_form(); - $view->content->version = ''; + $view->content->version = ""; if (g2_import::is_initialized()) { $view->content->g2_stats = $g2_stats; @@ -41,6 +41,8 @@ class Admin_g2_import_Controller extends Admin_Controller { $view->content->thumb_size = module::get_var("gallery", "thumb_size"); $view->content->resize_size = module::get_var("gallery", "resize_size"); $view->content->version = g2_import::version(); + } else if (g2_import::is_configured()) { + $view->content->form->configure_g2_import->embed_path->add_error("invalid", 1); } g2_import::restore_error_reporting(); print $view; -- cgit v1.2.3 From 179161d05ee037292202a15507d38166f8a7ee4a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 16 Jun 2010 15:07:13 -0700 Subject: Fix two bugs: #1161: guest comments get dropped because of a missing email address. #1075: G2 comments with " get turned into " --- modules/g2_import/helpers/g2_import.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/g2_import') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 575d02bb..2a549146 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -826,6 +826,7 @@ class g2_import_Core { $text .= " "; } $text .= $g2_comment->getComment(); + $text = html_entity_decode($text); // Just import the fields we know about. Do this outside of the comment API for now so that // we don't trigger spam filtering events @@ -835,6 +836,7 @@ class g2_import_Core { if ($comment->author_id == identity::guest()->id) { $comment->guest_name = $g2_comment->getAuthor(); $comment->guest_name or $comment->guest_name = (string) t("Anonymous coward"); + $comment->guest_email = "unknown@nobody.com"; } $comment->item_id = $item_id; $comment->text = self::_transform_bbcode($text); -- cgit v1.2.3 From 8d1c6887a5120e7fe1302a327043f512c8b5da7d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 16 Jun 2010 15:12:00 -0700 Subject: Fix a bug introduced in 1077477a9032d5a4855e19e2dd4ce923472b711c where we don't generate album highlights correctly. Possible fix for #1054. --- modules/g2_import/helpers/g2_import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/g2_import') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 2a549146..f0e62854 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -502,7 +502,7 @@ class g2_import_Core { } try { $g3_album->save(); - graphics::generate($g2_album); + graphics::generate($g3_album); } catch (Exception $e) { return (string) new G2_Import_Exception( t("Failed to generate an album highlight for album '%name'.", -- cgit v1.2.3 From 2025c2c37d8607fa5f296a9b6912577989e90bc3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 16 Jun 2010 15:53:07 -0700 Subject: If the G2 orderBy or orderDirection fields are blank, use the G2 defaults. Second half of fix for #1054. --- modules/g2_import/helpers/g2_import.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/g2_import') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index f0e62854..c0ea09d6 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -438,8 +438,15 @@ class g2_import_Core { // Only consider G2's first sort order $g2_order = explode("|", $g2_album->getOrderBy() . ""); $g2_order = $g2_order[0]; + if (empty($g2_order)) { + $g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy')); + } $g2_order_direction = explode("|", $g2_album->getOrderDirection() . ""); $g2_order_direction = $g2_order_direction[0]; + if (empty($g2_order_direction)) { + $g2_order_direction = + g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderDirection')); + } if (array_key_exists($g2_order, $order_map)) { $album->sort_column = $order_map[$g2_order]; $album->sort_order = $direction_map[$g2_order_direction]; -- cgit v1.2.3 From 3feb561054a735e6959e894eb568aa386426bb65 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 3 Jul 2010 11:40:56 -0700 Subject: Internationalize the "Gallery 2 path saved." message and remove the trailing period. Fixes ticket #1171. --- modules/g2_import/controllers/admin_g2_import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/g2_import') diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index cc60f757..b9427f79 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -60,7 +60,7 @@ class Admin_g2_import_Controller extends Admin_Controller { } if (g2_import::is_valid_embed_path($embed_path)) { - message::success("Gallery 2 path saved."); + message::success(t("Gallery 2 path saved")); module::set_var("g2_import", "embed_path", $embed_path); url::redirect("admin/g2_import"); } else { -- cgit v1.2.3