Skip to content
Snippets Groups Projects
Commit e23cd9ca authored by efalcy's avatar efalcy
Browse files

When browsing domains, root domain links to homepage

parent 2979ee88
Branches
Tags
2 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!1112091 Domains Browsing
......@@ -84,17 +84,20 @@ class ZendAfi_View_Helper_RenderDomainBrowser extends ZendAfi_View_Helper_BaseHe
protected function getBrowsingUrl($domain) {
xdebug_break();
if ($domain->getId()==$this->_pref['root_domain_id'])
return $this->view->url([], null, true);
$params = $domain->hasSousDomaines()
? array_filter(['controller' =>'domains',
? ['controller' =>'domains',
'action' => 'browse',
'id'=> $domain->getId(),
'id_module' => $this->_id_module
])
: array_filter(['controller' =>'recherche',
]
: ['controller' =>'recherche',
'action' => 'simple',
'id_catalogue'=> $domain->getId(),
'id_module' => $this->_id_module
]);
];
return $this->view->url($params, null, true);
}
......
......@@ -99,9 +99,9 @@ class DomainsControllerBrowseALetterDomainTest extends DomainsControllerBrowseTe
/** @test */
public function shouldDisplayLinkToYouthDomain() {
public function youthDomainshouldLinkToHomepage() {
$this->assertXPath('//div[@class="breadcrumb_domains"]/ul/li/'
. 'a[@href="/domains/browse/id/3/id_module/9"]/img[@src="http://imgs/youth.png"]'
. 'a[@href="/"]/img[@src="http://imgs/youth.png"]'
. '[following-sibling::span]',$this->_response->getBody());
}
}
......
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