diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-09 10:17:48 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-09 10:17:48 -0800 |
commit | dcee225935007fea06360591ab31546ac8495784 (patch) | |
tree | 5144ddddc493f8d5da48f9bc7202aabdffc6c5b1 | |
parent | 1b60078bf7457046968174ae76164d25d21cf93d (diff) |
Better handling of G2's multi level sort order in g2_import
-rw-r--r-- | modules/g2_import/helpers/g2_import.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 80feb7d0..d3ed92e8 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -389,9 +389,14 @@ class g2_import_Core { $direction_map = array( ORDER_ASCENDING => "asc", ORDER_DESCENDING => "desc"); - if (array_key_exists($g2_order = $g2_album->getOrderBy(), $order_map)) { + // Only consider G2's first sort order + $g2_order = explode("|", $g2_album->getOrderBy() . ""); + $g2_order = $g2_order[0]; + $g2_order_direction = explode("|", $g2_album->getOrderDirection() . ""); + $g2_order_direction = $g2_order_direction[0]; + if (array_key_exists($g2_order, $order_map)) { $album->sort_column = $order_map[$g2_order]; - $album->sort_order = $direction_map[$g2_album->getOrderDirection()]; + $album->sort_order = $direction_map[$g2_order_direction]; } $album->save(); |