Skip to content

Move plugindetect.js javascript frontoffice registration from hook displayBeforeBodyClosingTag to displayHeader#38

Open
mcaldex wants to merge 3 commits intoPrestaShop:devfrom
mcaldex:bugfix/plugindetect_js_fix
Open

Move plugindetect.js javascript frontoffice registration from hook displayBeforeBodyClosingTag to displayHeader#38
mcaldex wants to merge 3 commits intoPrestaShop:devfrom
mcaldex:bugfix/plugindetect_js_fix

Conversation

@mcaldex
Copy link
Copy Markdown

@mcaldex mcaldex commented Feb 5, 2026

Questions Answers
Description? Fixes the console error "Uncaught ReferenceError: PluginDetect is not defined" caused by the fact that the PluginDetect library .js file cannot be added to the frontoffice using the displayBeforeBodyClosingTag hook
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? see browser console the first time you open the frontoffice while this module is enabled: you should see the "Uncaught ReferenceError: PluginDetect is not defined" does not popup anymore.

@ps-jarvis
Copy link
Copy Markdown

Hello @mcaldex!

This is your first pull request on statsdata 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 Feb 5, 2026
@mcaldex
Copy link
Copy Markdown
Author

mcaldex commented Feb 5, 2026

@kpodemski hi, I hope this makes sense.
Would be great to LGTM #37 also :)

thanks

@mcaldex
Copy link
Copy Markdown
Author

mcaldex commented Feb 5, 2026

anyways, at the end of the day, this fixes only the insertion of some Guest's properties such as:
screen_resolution_x, width, screen_resolution_y, adobe_flash etc.

I'm not sure it those properties are useful anyways, but this still fixes the error in the browser's console which is the main reason I digged a bit and found this issue on my prestashop.

@mcaldex
Copy link
Copy Markdown
Author

mcaldex commented Feb 25, 2026

@Touxten @Quetzacoalt91 hey, lmk what you guys think.
Should we rather fix the loading of this js plugin when the PS_STATSDATA_PLUGINS configuration is enabled, or completely remove it from the module?

Quetzacoalt91
Quetzacoalt91 previously approved these changes Feb 25, 2026
Copy link
Copy Markdown
Member

@Quetzacoalt91 Quetzacoalt91 left a comment

Choose a reason for hiding this comment

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

The changes look good to me, however it would be better to have an issue first to confirm there is an issue to fix.

Add newline at the end of the file for consistency.
Add missing newline at end of file
@kpodemski kpodemski closed this Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Ready for review to Closed in PR Dashboard Mar 25, 2026
@kpodemski kpodemski reopened this Mar 25, 2026
@ps-jarvis ps-jarvis moved this from Closed to To be tested in PR Dashboard Mar 25, 2026
@github-project-automation github-project-automation bot moved this from Closed to Reopened in PR Dashboard Mar 25, 2026
@ps-jarvis ps-jarvis moved this from To be tested to Closed in PR Dashboard Mar 25, 2026
@kpodemski kpodemski added this to the 2.1.3 milestone Mar 25, 2026
Copy link
Copy Markdown

@paulnoelcholot paulnoelcholot left a comment

Choose a reason for hiding this comment

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

Hello @mcaldex,

I tested your PR but I have somes problem. I don't found the error "Uncaught ReferenceError: PluginDetect is not defined" with or without your PR. And with your PR, when I inspect the code I don't found plugindetect.

Did I miss something?

Thanks!

PR-2026-03-26_14.22.27.mp4

@mcaldex
Copy link
Copy Markdown
Author

mcaldex commented Mar 27, 2026

Hi @paulnoelcholot , that's because the error will show up only if there's no id_guest set in the cookie, thus it will only appear on the very first time you open up the frontoffice with your browser.
Please try to go incognito every time you need to test it out and open the console, lmk thanks :)

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

Projects

Status: Reopened

Development

Successfully merging this pull request may close these issues.

5 participants