Skip to content

Fix inline stylesheet rendering with nofilter#1047

Merged
tblivet merged 1 commit into
PrestaShop:2.xfrom
Maofree:patch-1
Jun 18, 2026
Merged

Fix inline stylesheet rendering with nofilter#1047
tblivet merged 1 commit into
PrestaShop:2.xfrom
Maofree:patch-1

Conversation

@Maofree

@Maofree Maofree commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
609135009-745676b6-04e3-4244-ae50-f17d8da390a4 Double quotes in the CSS code are converted to " and single quotes are converted to ' so the CSS code on the page doesn't work.
Questions Answers
Description? using the inline option in registerStylesheet with 'inline' => true Double quotes in the CSS code are converted to " and single quotes are converted to ' so the CSS code on the page doesn't work.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#41752
How to test? you need to add a file in a demo module you are using with this code

NOTE: @ingridusta here is a module to perform tests 🙂
inlinecsstest.zip

$this->context->controller->registerStylesheet(
'modules-'.$this->name.'-hide-alias',
'/modules/'.$this->name.'/views/css/hide-alias.css',
['media' => 'all', 'priority' => 151, 'inline' => true]
);

then go into the source code of the front part of a page and see what code comes out

Schermata del 2026-06-17 12-37-25 Schermata del 2026-06-17 12-39-07

Double quotes in the CSS code are converted to " and single quotes are converted to '
so the CSS code on the page doesn't work.
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Jun 17, 2026
@Maofree

Maofree commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@Maofree

Maofree commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

in the file javascript.tpl is already present

  <script type="text/javascript">
    {$js.content nofilter}
  </script>

@tblivet tblivet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Maofree 🙏

@ingridusta ingridusta added the Waiting for QA Status: Action required, Waiting for test feedback label Jun 17, 2026
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Jun 17, 2026
@ingridusta ingridusta self-assigned this Jun 17, 2026

@ingridusta ingridusta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Maofree,

Thanks @tblivet for the module, to be able to test it easily !

I reproduced the bug :

Image

And tested again from your PR :

Image

It's QA approved ✅ Thanks for your contribution !

@tblivet tblivet added this to the v2.1.0 milestone Jun 18, 2026
@tblivet tblivet added QA ✔️ Status: Check done, Code approved and removed Waiting for QA Status: Action required, Waiting for test feedback labels Jun 18, 2026
@tblivet tblivet merged commit 878a5b8 into PrestaShop:2.x Jun 18, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from To be tested to Merged in PR Dashboard Jun 18, 2026
@ps-jarvis ps-jarvis moved this from Merged to To be tested in PR Dashboard Jun 18, 2026
@Maofree

Maofree commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Hi @tblivet
Just to clarify, I saw that it was merged into the 2.x branch but not into the dev branch, I see that it still doesn't have this fix. How will you merge it into the dev branch?

@tblivet

tblivet commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Hi @Maofree,
We try to regularly merge 2.x into develop to keep both branches in sync, so this fix will land in develop during one of those merges most likely sometime next week.
Thanks again for the contribution 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA ✔️ Status: Check done, Code approved

Projects

Status: To be tested

Development

Successfully merging this pull request may close these issues.

4 participants