diff --git a/VERSIONS_HOTLINE/59813 b/VERSIONS_HOTLINE/59813 new file mode 100644 index 0000000000000000000000000000000000000000..3624f2aa8fa01089814b86b54d97492bf9d76217 --- /dev/null +++ b/VERSIONS_HOTLINE/59813 @@ -0,0 +1 @@ + - ticket #59813 : correction de la prise en compte du CSS personnalisé du profil sur la page d'accueil avec "utilisation du CSS parent" décoché. \ No newline at end of file diff --git a/application/modules/opac/views/scripts/head.phtml b/application/modules/opac/views/scripts/head.phtml index bb0f428ecc23a1c4ccabde2064e67c8d387c2edd..875e3a45c72a2a1ade413ef5cb0fc83ed8a01192 100644 --- a/application/modules/opac/views/scripts/head.phtml +++ b/application/modules/opac/views/scripts/head.phtml @@ -63,7 +63,7 @@ if (Class_Users::isCurrentUserAdmin()) { } -if ($this->header_css && $current_profil->getUseParentCss() && !$current_profil->hasPageCss()) +if ($this->header_css && ($current_profil->getUseParentCss() || !$current_profil->hasParentProfil()) && !$current_profil->hasPageCss()) $head_scripts->addStyleSheet($this->header_css, ['id' => 'profil_css', 'media' => 'all']); diff --git a/tests/application/modules/opac/controllers/IndexControllerTest.php b/tests/application/modules/opac/controllers/IndexControllerTest.php index d1f1d9805d4508270172e02d28460e65013b76be..9c47de6bf92d1d2225f9c28d231bb3c0ffde1dab 100644 --- a/tests/application/modules/opac/controllers/IndexControllerTest.php +++ b/tests/application/modules/opac/controllers/IndexControllerTest.php @@ -135,7 +135,6 @@ class IndexControllerAsAdminWithCssEditorAndNoHeaderCss extends IndexControllerA class IndexControllerAsAdminWithCSSEditorTest extends IndexControllerAsAdminTestCase { public function setUp() { parent::setUp(); - $this->dispatch('/?id_profil=1'); } @@ -150,7 +149,27 @@ class IndexControllerAsAdminWithCSSEditorTest extends IndexControllerAsAdminTest public function headerCssShouldBeMyCssWithCacheWorkaround() { $this->assertXPath('//link[contains(@href, "mycss.css")][contains(@href, "?cache=")]'); } +} + + +class IndexControllerAsAdminWithCSSEditorAndUseParentCssFalseTest extends IndexControllerAsAdminTestCase { + public function setUp() { + parent::setUp(); + + //@see http://forge.afi-sa.fr/issues/59813 + Class_Profil::find(1) + ->setUseParentCss(false) + ->assertSave(); + + $this->dispatch('/?id_profil=1'); + } + + + /** @test */ + public function headerCssShouldBeMyCss() { + $this->assertXPath('//link[contains(@href, "mycss.css")][contains(@href, "?cache=")]'); + } }