Skip to content
Snippets Groups Projects
Commit 99ca97b3 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'dev#156519_fichier_css_de_herisson_a_intonation' into 'master'

hotline #156519 fix loading of css patch for themes

See merge request !4562
parents 1ab78538 085ca243
Branches
Tags
1 merge request!4562hotline #156519 fix loading of css patch for themes
Pipeline #18858 passed with stage
in 21 minutes and 28 seconds
- correction #156519 : Correction du chargement du fichier 2022_05_improve_thumbnail_rendering.css dans les thèmes.
\ No newline at end of file
...@@ -26,6 +26,8 @@ class Class_Template { ...@@ -26,6 +26,8 @@ class Class_Template {
Trait_Translator, Trait_Translator,
Trait_StormFileSystem; Trait_StormFileSystem;
const TEMPLATES_CSS_PATCHS_FOLDER = 'templates_patchs';
const TEMPLATES_CSS_PATCHS = ROOT_PATH . 'public/opac/css/' . self::TEMPLATES_CSS_PATCHS_FOLDER . '/';
protected static $_instance; protected static $_instance;
...@@ -726,8 +728,7 @@ class Class_Template { ...@@ -726,8 +728,7 @@ class Class_Template {
public function getCssPatchsFiles() : array { public function getCssPatchsFiles() : array {
$files_names = $this->getFileSystem()->fileNamesAt(TEMPLATES_CSS_PATCHS); return $this->getFileSystem()->fileNamesAt(static::TEMPLATES_CSS_PATCHS);
return array_combine($files_names, $files_names);
} }
......
...@@ -186,7 +186,6 @@ class Bokeh_Engine { ...@@ -186,7 +186,6 @@ class Bokeh_Engine {
defineConstant('MEMCACHED_PORT', '11211'); defineConstant('MEMCACHED_PORT', '11211');
defineConstant('IMAGE_MAGICK_PATH', 'convert'); defineConstant('IMAGE_MAGICK_PATH', 'convert');
defineConstant('THUMBNAIL_FIT_WIDTH_HEIGHT', '500'); defineConstant('THUMBNAIL_FIT_WIDTH_HEIGHT', '500');
defineConstant('TEMPLATES_CSS_PATCHS', ROOT_PATH . "public/opac/css/templates_patchs/");
defineConstant('PATCH_PATH', ROOT_PATH . 'cosmogramme/sql/patch/'); defineConstant('PATCH_PATH', ROOT_PATH . 'cosmogramme/sql/patch/');
defineConstant('GIT_REALTIME',false); defineConstant('GIT_REALTIME',false);
......
...@@ -94,12 +94,9 @@ class Intonation_Library_Styles { ...@@ -94,12 +94,9 @@ class Intonation_Library_Styles {
public function cssPatchsUrls() : array { public function cssPatchsUrls() : array {
$css = []; return array_map(fn($file_name) => Class_ScriptLoader::getInstance()
foreach($this->_template->getCssPatchs() as $css_file_name) ->opacStyleSheetUrlFor(Class_Template::TEMPLATES_CSS_PATCHS_FOLDER . "/" . $file_name),
$css [] = (Class_ScriptLoader::getInstance() $this->_template->getCssPatchs());
->opacStyleSheetUrlFor(BASE_URL . TEMPLATES_CSS_PATCHS . $css_file_name));
return $css;
} }
......
...@@ -73,7 +73,7 @@ class CssPatchsIndexNewTemplate202205Test extends AbstractControllerTestCase { ...@@ -73,7 +73,7 @@ class CssPatchsIndexNewTemplate202205Test extends AbstractControllerTestCase {
/** @test */ /** @test */
public function cssFile202205ImproveThumbnailRenderingCssShouldBeLinked() { public function cssFile202205ImproveThumbnailRenderingCssShouldBeLinked() {
$this->assertXPath('//head//link[contains(@href, "/public/opac/css/templates_patchs/2022_05_improve_thumbnail_rendering.css?v")]'); $this->assertContains('<link type="text/css" rel="stylesheet" href="' . BASE_URL . '/public/opac/css/templates_patchs/2022_05_improve_thumbnail_rendering.css?v=', $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