summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-16 15:53:07 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-16 15:53:07 -0700
commit2025c2c37d8607fa5f296a9b6912577989e90bc3 (patch)
tree36b63caffdbbf08b4a2af625d81ea6670b10e3f2 /modules
parent8d1c6887a5120e7fe1302a327043f512c8b5da7d (diff)
If the G2 orderBy or orderDirection fields are blank, use the G2 defaults.
Second half of fix for #1054.
Diffstat (limited to 'modules')
-rw-r--r--modules/g2_import/helpers/g2_import.php7
1 files changed, 7 insertions, 0 deletions
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];