diff --git a/modules/g2_import/classes/G2Import/Controller/G2.php b/modules/g2_import/classes/G2Import/Controller/G2.php index a2ae5de36a..f911d3ea0b 100644 --- a/modules/g2_import/classes/G2Import/Controller/G2.php +++ b/modules/g2_import/classes/G2Import/Controller/G2.php @@ -44,12 +44,12 @@ public function action_map() { $tag_name = $this->request->query("g2_tagName"); } - if (!$id) { - $this->redirect("tag_name/$tag_name", 301); - } - $tag = ORM::factory("Tag")->where("name", "=", $tag_name)->find(); if ($tag->loaded()) { + if (!$id) { + $this->redirect($tag->abs_url(), 301); + } + Item::set_display_context_callback("Controller_Tags::get_display_context", $tag->id); // We want to show the item as part of the tag virtual album. Most of this code is below; we'll // change $path and $view to let it fall through