Skip to content

fix: resolve all confirmed bugs (#75, #76, #77, #78, #9, root cause of #69)#79

Open
olivierbinet-code wants to merge 1 commit intoPrestaShop:devfrom
olivierbinet-code:fix/bugs-75-78-issue-9
Open

fix: resolve all confirmed bugs (#75, #76, #77, #78, #9, root cause of #69)#79
olivierbinet-code wants to merge 1 commit intoPrestaShop:devfrom
olivierbinet-code:fix/bugs-75-78-issue-9

Conversation

@olivierbinet-code
Copy link
Copy Markdown

@olivierbinet-code olivierbinet-code commented Mar 3, 2026

Questions Answers
Description? Fix 6 confirmed bugs in ps_banner v2.1.2: missing closing > on <img> tag (#75), getWidgetVariables() returning incomplete variable set (#76), updateUrl() hardcoding http:// (#77), shared banner image deleted when uploading for one language (#78, root cause of #69), and banner hidden on mobile after fresh install (#9). Also fixes coding standard violations (line length) across the file.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#75, Fixes PrestaShop/PrestaShop#76, Fixes PrestaShop/PrestaShop#77, Fixes PrestaShop/PrestaShop#78, Fixes PrestaShop/PrestaShop#9
How to test? See test plan below.

Test plan

  • Validate rendered HTML via https://validator.w3.org/nu/<img> should have no parse errors
  • Confirm getWidgetVariables() returns all 5 keys: banner_img, banner_width, banner_height, banner_link, banner_desc
  • Test updateUrl() with: bare domain (example.com), http://, https://, and //example.com — only bare domain should get a protocol prepended
  • On an HTTPS store, confirm bare-domain links get https:// not http://
  • Set two languages to the same banner image, upload a new banner for one language only, confirm the other language's banner is still visible
  • Fresh install: confirm the banner is visible on mobile without any manual configuration
    🤖 Generated with Claude Code

@ps-jarvis
Copy link
Copy Markdown

Hello @olivierbinet-code!

This is your first pull request on ps_banner 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 Mar 3, 2026
@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Mar 3, 2026

@PrestaShop/committers I think some rules of AI usage should be established. Not only we have the repository spammed by a robot, but the PR and the issue doesn't follow any required template at all.

@kpodemski
Copy link
Copy Markdown
Contributor

@Hlavtox

there are some already

https://devdocs.prestashop-project.org/9/contribute/contribution-guidelines/#on-ai-use-in-contributions

I'm not against fixing things, but not following the rules definitely won't be acceptable.

@kpodemski
Copy link
Copy Markdown
Contributor

That being said, I think this PR is just a test 😀

@Hlavtox
Copy link
Copy Markdown
Contributor

Hlavtox commented Mar 3, 2026

Vibe coding hell finally reached our project 😄

@tleon
Copy link
Copy Markdown

tleon commented Mar 4, 2026

Hello thanks for your first contribution.
There are a couple of things that can be improved on this PR.
We have some templates for the issues and for the pull requests.
Following those templates, help us a lot in order to filter the issues so they can be handled as fast as possible.
Here is an example of a PR that respect the template
Here is an example of an issue that respect the template

We also encourage our new contributors to have a look at our guidelines
In your case I think this section is particularly appropriate since you used an ai agent to help you.

There is also a problem on this module that uses an old version of phpstan. There is a fix that is already done and has to be implemented on each module one by one. This is a bit much for a first time contributor so we will do a PR to fix this and then you'll have to rebase yours in order to fix your CI. I'll keep you in touch once i'll do the fix.

@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 9, 2026

Hello @olivierbinet-code

CI PhPstan fixed can you close and reopen your PR or reabase 🤣

@jf-viguier jf-viguier closed this Mar 19, 2026
@github-project-automation github-project-automation bot moved this from Ready for review to Closed in PR Dashboard Mar 19, 2026
@jf-viguier jf-viguier reopened this Mar 19, 2026
@github-project-automation github-project-automation bot moved this from Closed to Reopened in PR Dashboard Mar 19, 2026
Copy link
Copy Markdown
Contributor

@ga-devfront ga-devfront left a comment

Choose a reason for hiding this comment

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

CS fixer stil broken and E2E tests too. Please fix it.

@github-project-automation github-project-automation bot moved this from Reopened to Closed in PR Dashboard Mar 19, 2026
@github-project-automation github-project-automation bot moved this from Closed to Reopened in PR Dashboard Mar 19, 2026
@ga-devfront
Copy link
Copy Markdown
Contributor

I don't know how you managed to do that, but it needs to be rebased.

@olivierbinet-code
Copy link
Copy Markdown
Author

I don't know how you managed to do that, but it needs to be rebased.

I was rebasing... you went too fast...

@olivierbinet-code
Copy link
Copy Markdown
Author

I don't know how you managed to do that, but it needs to be rebased.

I was rebasing... you went too fast...

Hi @ga-devfront, I've rebased on dev, fixed the coding standard violations, and updated the PR description to follow the template. Could you re-review when you have a chance? Note that the CI workflows are awaiting maintainer approval to run.

@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 19, 2026

I've started testing again, my friend.

@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 19, 2026

PHP stan not happy my friend

@olivierbinet-code
Copy link
Copy Markdown
Author

Just pushed a fix — I had missed the CRLF line ending issue introduced by Windows. Set core.autocrlf false and re-committed. The file should now pass PHP-CS-Fixer.

@kpodemski
Copy link
Copy Markdown
Contributor

The problem was introduced during rebase. You have <<<<<<< HEAD visible in your code, indicating that. That's why the tests fail, the file is broken.

@olivierbinet-code
Copy link
Copy Markdown
Author

The problem was introduced during rebase. You have <<<<<<< HEAD visible in your code, indicating that. That's why the tests fail, the file is broken.

Yes I saw that, it should be fixed now

@kpodemski
Copy link
Copy Markdown
Contributor

@olivierbinet-code

Here are all the problems reported by PHPStan:

Error: Syntax error, unexpected T_SL on line 53
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting '-' or T_STRING or T_VARIABLE or T_NUM_STRING on line 113
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 122
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 160
⚠️  Result is incomplete because of severe errors. ⚠️
   Fix these errors first and then re-run PHPStan
   to get all reported errors.

Elapsed time: 2 seconds
Used memory: 74.5 MB
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 172
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 213
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 215
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 216
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 225
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 233
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 239
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 241
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 251
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 253
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 262
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 264
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 272
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 280
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 281
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 282
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 283
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 284
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 285
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 286
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 287
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 288
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 289
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 290
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 291
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 292
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 293
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 294
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 295
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 296
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 299
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 326
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 327
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 330
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 335
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 336
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 342
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 344
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 349
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 351
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 354
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 355
Error: Syntax error, unexpected T_ENCAPSED_AND_WHITESPACE on line 369
Error: Process completed with exit code 1.

@olivierbinet-code
Copy link
Copy Markdown
Author

yes wrong file, my bad Krystian

@ps-jarvis ps-jarvis added the Waiting for QA Status: Action required, Waiting for test feedback label Mar 19, 2026
@ps-jarvis ps-jarvis moved this from Reopened to To be tested in PR Dashboard Mar 19, 2026
@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 23, 2026

Hello bot Binet on my PR i have this comment

I'm not sure that's a good idea. Full width banners suited for desktop version usually don't look good on mobile. Besides having a banner on top of every page, especially on mobile isn't useful. Unless the module provides a way to add a mobile version of the banner it's better to keep it disabled.

Please don't cheat and use AI

@paulnoelcholot paulnoelcholot removed the Waiting for QA Status: Action required, Waiting for test feedback label Mar 24, 2026
@paulnoelcholot paulnoelcholot moved this from To be tested to Waiting for author in PR Dashboard Mar 24, 2026
@olivierbinet-code
Copy link
Copy Markdown
Author

Hello bot Binet on my PR i have this comment

I'm not sure that's a good idea. Full width banners suited for desktop version usually don't look good on mobile. Besides having a banner on top of every page, especially on mobile isn't useful. Unless the module provides a way to add a mobile version of the banner it's better to keep it disabled.

Please don't cheat and use AI

Thanks @Touxten for flagging this. The concern about mobile rendering is valid — a full-width desktop banner may not always look good on mobile. However, the issue with the original code is not the default choice itself, but that disableDevice(Context::DEVICE_MOBILE) in install() creates a one-way trap: once disabled, there is no UI toggle in the banner module's configuration to re-enable it. Merchants who want the banner on mobile have no recourse short of editing the database directly.
The fix removes the blanket disable so merchants can make an informed choice via the Positions page in the back office — which is the appropriate place to manage device visibility for any hook. If the community prefers keeping mobile disabled by default, the right solution would be to add an explicit toggle in the module's settings, not to silently lock it out.

@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 27, 2026

That’s not a bad answer, but it would be worth looking further into it and configuring the core deprecations.

You could have realised that this method is going to be removed, so it’s pointless.

https://github.com/search?q=repo%3APrestaShop%2FPrestaShop%20disableDevice&type=code

@olivierbinet-code
Copy link
Copy Markdown
Author

Good point @Touxten — I've just checked and disableDevice is indeed deprecated since 9.0.0, with the explicit note that "there is no replacement, all clients should have the same experience." That actually makes our fix stronger: removing the call avoids triggering the deprecation warning and aligns with the intended direction of the core.

@Touxten
Copy link
Copy Markdown
Contributor

Touxten commented Mar 27, 2026

Il est bon !

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

Labels

None yet

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

[+] BO : add customer message directly in the order details page [-] FO : mobile template - states management

9 participants