summaryrefslogtreecommitdiff
path: root/modules/g2_import
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-04-24 22:45:45 -0700
committerBharat Mediratta <bharat@menalto.com>2011-04-24 22:45:45 -0700
commit701c1fb12f2f254d8d7e7756a09cb5e825123a2f (patch)
tree15924a5605bd313ee2c3c8b9e393d13cd2538935 /modules/g2_import
parent15f4657452795c2852c58c9f1840ce4e1f58d401 (diff)
Ignore the presort when transferring over sort orders. Fixes #1710.
Diffstat (limited to 'modules/g2_import')
-rw-r--r--modules/g2_import/helpers/g2_import.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index e9c19c9d..50ab8a23 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -475,9 +475,10 @@ class g2_import_Core {
1 => "ASC",
ORDER_ASCENDING => "ASC",
ORDER_DESCENDING => "DESC");
- // Only consider G2's first sort order
+ // G2 sorts can either be <sort> or <presort>|<sort>. Right now we can't
+ // map presorts so ignore them.
$g2_order = explode("|", $g2_album->getOrderBy() . "");
- $g2_order = $g2_order[0];
+ $g2_order = end($g2_order);
if (empty($g2_order)) {
$g2_order = g2(GalleryCoreApi::getPluginParameter('module', 'core', 'default.orderBy'));
}