Skip to content

Don't render empty markup in the newsletter checkbox label - #132

Merged
kpodemski merged 2 commits into
PrestaShop:devfrom
boo-code:fix/empty-newsletter-conditions-label-130
Aug 26, 2026
Merged

kpodemski merged 2 commits into
PrestaShop:devfrom
boo-code:fix/empty-newsletter-conditions-label-130

Conversation

@boo-code

Copy link
Copy Markdown
Contributor
Questions Answers
Description? hookAdditionalCustomerFormFields() builds the newsletter checkbox label by always wrapping the newsletter conditions in <br> + <em>…</em>. When the "Newsletter conditions" setting (NW_CONDITIONS) is empty for the language, the label ends with a stray Sign up for our newsletter<br><em></em>, adding an empty line and emphasis element under the checkbox. The fix only emits the <br>/<em> markup when there is actually some conditions text; otherwise the placeholders collapse and the label is simply "Sign up for our newsletter". The same translation key is kept, so no new wording is introduced.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #130.
How to test? Modules → Newsletter subscription → Configure, clear the "Newsletter conditions" field for the active language and save, then open the registration form / guest checkout newsletter checkbox and inspect the label markup. Before: Sign up for our newsletter<br><em></em>. After: Sign up for our newsletter. With conditions text configured the label is unchanged (Sign up for our newsletter<br><em>…</em>) — verified both cases.
Sponsor company

Reported by @darkf3d3.

hookAdditionalCustomerFormFields() always wrapped the newsletter conditions in a
line break and an emphasis element, so when no conditions text is configured
(NW_CONDITIONS empty) the label ended with a stray "<br><em></em>". Only emit the
markup when there is some conditions text to show; otherwise the label is just
"Sign up for our newsletter".
@ps-jarvis

Copy link
Copy Markdown

Hello @boo-code!

This is your first pull request on ps_emailsubscription repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Jun 27, 2026
Removed comments regarding rendering conditions in the customer form fields.
@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Jul 2, 2026
@kpodemski kpodemski added this to the 3.0.1 milestone Aug 26, 2026
@kpodemski
kpodemski merged commit f93a7f2 into PrestaShop:dev Aug 26, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from To be tested to Merged in PR Dashboard Aug 26, 2026
@kpodemski kpodemski added QA ✔️ Status: Check done, Code approved and removed Waiting for QA labels Aug 26, 2026
@kpodemski

Copy link
Copy Markdown
Contributor

thank you @boo-code

@Progi1984 Progi1984 added the QA ✔️ by Community Status: Check done by community member, Code approved label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA ✔️ by Community Status: Check done by community member, Code approved QA ✔️ Status: Check done, Code approved

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Empty <br><em></em> rendered in newsletter checkbox label when NW_CONDITIONS is empty

5 participants