diff --git a/classes/ComicPressComicPost.inc b/classes/ComicPressComicPost.inc index e2a6287..733397e 100644 --- a/classes/ComicPressComicPost.inc +++ b/classes/ComicPressComicPost.inc @@ -206,9 +206,6 @@ class ComicPressComicPost { function get_parent_categories() { $parents = wp_get_post_categories($this->post->ID); - do { - $parents - } while ($parents_found); } } diff --git a/classes/ComicPressNavigation.inc b/classes/ComicPressNavigation.inc index bc83178..06f8608 100644 --- a/classes/ComicPressNavigation.inc +++ b/classes/ComicPressNavigation.inc @@ -18,10 +18,8 @@ class ComicPressNavigation { } // global first/last - if ($root_category = $this->_storyline->root_category) { - foreach (array('first', 'last') as $field) { - $nav[$field] = $this->_dbi->{"get_${field}_comic"}($root_category); - } + foreach (array('first', 'last') as $field) { + $nav[$field] = $this->_dbi->{"get_${field}_comic"}(null); } if ($category = $this->_storyline->get_valid_post_category($post->ID)) { diff --git a/test/ComicPressNavigationTest.php b/test/ComicPressNavigationTest.php index a135904..fa484fc 100644 --- a/test/ComicPressNavigationTest.php +++ b/test/ComicPressNavigationTest.php @@ -30,8 +30,8 @@ class ComicPressNavigationTest extends PHPUnit_Framework_TestCase { $dbi->expects($this->at(0))->method('get_previous_comic')->with(null, $post); $dbi->expects($this->at(1))->method('get_next_comic')->with(null, $post); - $dbi->expects($this->at(2))->method('get_first_comic')->with(1); - $dbi->expects($this->at(3))->method('get_last_comic')->with(1); + $dbi->expects($this->at(2))->method('get_first_comic')->with(null); + $dbi->expects($this->at(3))->method('get_last_comic')->with(null); $dbi->expects($this->at(4))->method('get_previous_comic')->with(2, $post); $dbi->expects($this->at(5))->method('get_next_comic')->with(2, $post); $dbi->expects($this->at(6))->method('get_first_comic')->with(1);