Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebProfilerBundle] Wrapping exception js in Sfjs check and also loading base_js Sfjs if needed#41346

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromweaverryan:fix-sfjs-error
May 21, 2021

Conversation

@weaverryan
Copy link
Member

@weaverryanweaverryan commentedMay 20, 2021
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#41305
LicenseMIT
Doc PRNot needed

This bug was introduced in#41168.

Best viewed with:https://github.com/symfony/symfony/pull/41346/files?w=1 - we could also remove the new indentation inexception.js.

In that PR, we innocently don't reloadSfjs if it doesn't exist. However, on an error page, that template ALSO adds anSfjs, and thatSfjs issmaller - containing only a subset of theSfjs functions. This is tricky, but this PR fixes it.

Here are the various situations:

  1. I hit an exception page. TheSfjs fromexception.js is loaded first. This adds the smallerSfjs. Then thebase_js.html.twig version is hit. BecauseSfjs is missing theloadToolbar() method, that code DOES run again to reinitialize it.

  2. I am on a normal page, then travel to an exception page with Turbo. In this case, the originalSfjs frombase_js.html.twig was processed. Then, on the exception page, theSfjs fromexception.js is ignored, as is the 2nd execution ofbase_js.html.twig.

Overall, the JS could use some work for supporting things like Turbo (e.g.DOMContentLoaded doesn't work with Turbo, so the exception page JS is broken). But I wanted to focus on fixing the bug in this PR.

As a reminder,#41168 (avoiding overridingSfjs) was done to help with the AJAX toolbar and Turbo - it's explained in point (1) on#41168.

Cheers!

derrabus and mhujer reacted with rocket emoji
@derrabusderrabus added this to the4.4 milestoneMay 20, 2021
@carsonbotcarsonbot changed the titleWrapping exception js in Sfjs check and also loading base_js Sfjs if needed[WebProfilerBundle] Wrapping exception js in Sfjs check and also loading base_js Sfjs if neededMay 20, 2021
@derrabusderrabus changed the base branch from5.4 to4.4May 20, 2021 21:26
@derrabusderrabus reopened thisMay 20, 2021
@mhujer
Copy link
Contributor

@weaverryan I can confirm that this fixes#41305 on 5.2.8 👍

@nicolas-grekas
Copy link
Member

Thank you@weaverryan.

@nicolas-grekasnicolas-grekas merged commita76cdec intosymfony:4.4May 21, 2021
@weaverryanweaverryan deleted the fix-sfjs-error branchMay 27, 2021 16:58
This was referencedMay 31, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

Debug toolbar not showing on Symfony exception pages

5 participants

@weaverryan@mhujer@nicolas-grekas@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp