Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating jQuery throws JS errors #15

Open
hughbris opened this issue Mar 31, 2024 · 2 comments · May be fixed by #17
Open

Updating jQuery throws JS errors #15

hughbris opened this issue Mar 31, 2024 · 2 comments · May be fixed by #17
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hughbris
Copy link
Owner

hughbris commented Mar 31, 2024

After e04f724, users who want to run an updated jQuery using the conformance.jquery theme option will have a Javascript error in their consoles: Uncaught TypeError: e.indexOf is not a function thrown in /system/assets/jquery/jquery-3.x.min.js:2:85207 (love those minified file errors).

The only effect I've noticed on the theme functioning so far (in FF) has been that the dropdown menus don't drop. It's very likely there are more errors.

This makes the new option useless, unless you customise your template partials/asset-jquery.html.twig to make this error go away. And if you know how to do that, please share your genius here and I will make this issue go away.

Here is the back story:

After receiving these scary looking alerts from Github's friendly sweepers, I looked into them. They didn't seem likely to leave deployments of the theme vulnerable. I still wanted to fix them if it was simple.

CVE-2019-11358
CVE-2020-23064
CVE-2015-9251
CVE-2020-11022

I swapped out the line where the jQuery JS asset is included and simply added 'jquery'. This is where the JS runtime error was introduced. This has not affected my other official repository themes, Minimaxing and Landed, when clearing those advisories in the same way.

@hughbris hughbris added bug Something isn't working help wanted Extra attention is needed labels Mar 31, 2024
@hughbris
Copy link
Owner Author

  • remove links to this issue in code and docs when it is closed

kittyfishfrommars added a commit to kittyfishfrommars/grav-theme-solarize that referenced this issue Jul 17, 2024
kittyfishfrommars added a commit to kittyfishfrommars/grav-theme-solarize that referenced this issue Jul 17, 2024
kittyfishfrommars added a commit to kittyfishfrommars/grav-theme-solarize that referenced this issue Jul 17, 2024
kittyfishfrommars added a commit to kittyfishfrommars/grav-theme-solarize that referenced this issue Jul 17, 2024
@kittyfishfrommars kittyfishfrommars linked a pull request Jul 17, 2024 that will close this issue
@kittyfishfrommars
Copy link

Please see pull request bugfix: #15 updating jquery throws js errors #17

The immediate cause was a mismatch in the loading behaviour in line 30 and line 50.

Since it is now safe to drop the conformity check from solarize.yaml, I have done so.
This forces the theme to always use jQuery v.3.7.1 from its theme folder /vendor/js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants