Skip to content
Snippets Groups Projects
Commit 503f5435 authored by Sebastien ANDRE's avatar Sebastien ANDRE
Browse files

Merge branch 'hotline#133329_bug_navigation_entre_les_bibs' into 'hotline'

hotline: #133329 : bib rewrite url wrong nav

See merge request !4255
parents 67663113 115102d0
Branches
Tags
1 merge request!4255hotline: #133329 : bib rewrite url wrong nav
Pipeline #15056 passed with stage
in 28 minutes and 32 seconds
- 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
......@@ -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()),
......
......@@ -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"]');
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment