diff --git a/VERSIONS_HOTLINE/133329 b/VERSIONS_HOTLINE/133329 new file mode 100644 index 0000000000000000000000000000000000000000..64c6f52e5c8dd2a94c271148710aa99c2575da59 --- /dev/null +++ b/VERSIONS_HOTLINE/133329 @@ -0,0 +1 @@ + - ticket #133329 : Magasin de thèmes : Correction page bibliothèque, le lien de navigation précédent et suivant ne fonctionnait pas avec le mode url personnalisé \ No newline at end of file diff --git a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Navigation.php b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Navigation.php index 60b206a2882a762fc5d759fe5503ceef82032b07..a9cb6aacb639db32dd498d739d4983a31ddf8121 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Navigation.php +++ b/library/templates/Intonation/Library/View/Wrapper/Library/RichContent/Navigation.php @@ -65,7 +65,7 @@ class Intonation_Library_View_Wrapper_Library_RichContent_Navigation { if (!$prev = prev($list)) return; - return $this->_view->tagAnchor(['id' => $prev->getId()], + return $this->_view->tagAnchor($prev->getUrl(), Class_Template::current()->getIco($this->_view, 'previous', 'utils', ['class' => 'ico_xl']), ['title' => $this->_('Bibliothèque précédente : %s', $prev->getLibelle()), @@ -82,7 +82,7 @@ class Intonation_Library_View_Wrapper_Library_RichContent_Navigation { if (!$next = next($list)) return; - return $this->_view->tagAnchor(['id' => $next->getId()], + return $this->_view->tagAnchor($next->getUrl(), Class_Template::current()->getIco($this->_view, 'next', 'utils', ['class' => 'ico_xl']), ['title' => $this->_('Bibliothèque suivante : %s', $next->getLibelle()), diff --git a/tests/scenarios/Templates/TemplatesLibraryTest.php b/tests/scenarios/Templates/TemplatesLibraryTest.php index 77200fc8f84e8d1d83b2f222765183470b1a5713..544c1bc0141ef3521e81f187ac6ba86aeceedc7c 100644 --- a/tests/scenarios/Templates/TemplatesLibraryTest.php +++ b/tests/scenarios/Templates/TemplatesLibraryTest.php @@ -745,3 +745,35 @@ class TemplatesLibraryWidgetWithCarouselThreeColumnsAndOpeningHoursTest extends 'Mardi : 10h - 12h'); } } + + + + +class TemplatesLibraryWithRewriteUrlNavigationTest + extends TemplatesLibraryTestCase { + + public function setUp() { + parent::setUp(); + + Class_Bib::find(4) + ->setRewriteUrl('meythet') + ->assertSave(); + Class_Bib::find(5) + ->setRewriteUrl('pringy') + ->assertSave(); + + $this->dispatch('/meythet'); + } + + + /** @test */ + public function prevNavShouldHaveBibEnLirePlusId2Url() { + $this->assertXPath('//div[contains(@class, "jumbotron_previous")]//a[contains(@class, "previous")][@href="/annecy"]'); + } + + + /** @test */ + public function nextNavShouldHaveBibEnLirePlusId4Url() { + $this->assertXPath('//div[contains(@class, "jumbotron_next")]//a[contains(@class, "next")][@href="/pringy"]'); + } +}