-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
symfony 2 profiler bar throws javascript error in IE8 #13447
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
Comments
Can you send a pull request ? |
@pjordaan thanks for reporting this error and for taking the time to open this issue. As @stof said, the best thing for us would be to have a pull request which we can easily merge on symfony's maintained branches. As you already have made PR to Symfony in the past, I guess you have no problems at all with this process. If not, please tell us and we'll look for other contributor to take over this issue. Thanks! |
I wonder, why jQuery wasn't used to attach event, which would have solved the problem once and for all. |
@aik099 because we are not using jQuery... just plain JavaScript in the Web Profiler. |
In fact I've found 2 more places, where |
| Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR |
| Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR |
@weaverryan , I'd recommend using my fix #13636 instead. Can you please test it for me? |
No problem, only when using attachEvent, the keyword this in the eventHandler refers to the document object instead of the caller object... So additional code should be written to handle the this context. |
I've solved this in aik099@04f3f43 |
…n IE (aik099) This PR was merged into the 2.6 branch. Discussion ---------- [WebProfilerBundle] Fixes event listener attaching error in IE I haven't tested the change, because I don't any working Symfony installation at hand. By the looks of changes it should work. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | not sure (do we have JS tests?) | Fixed tickets | #13447 | License | MIT | Doc PR | Commits ------- 21693e4 [WebProfilerBundle] Fixes event listener attaching error in IE
Could you check the correctness of the fix of this issue? Seems to me that it broke the AJAX panel on Symfony 2.6.6. |
@parideo this PR has been merged before 2.6.5. It is not a 2.6.6 change |
I found the offending change though. See my PR |
This PR was merged into the 2.6 branch. Discussion ---------- Fix the AJAX profiling | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | reported in #13447 (comment) | License | MIT | Doc PR | n/a The fix for IE8 (#13978) which does not have the addEventListener method on XMLHttpRequest broke the feature for modern browsers because it was checking the existence on the wrong object. It is a method on the instance, not on the "class", and so should be checked on the prototype. Commits ------- 9d6c0b1 Fix the AJAX profiling
In IE8 and 9 the symfony 2 profiler throws a javascript error caused by the ajax requests logged.
IE8 and 9 do not have have a addEventListener object in XMLHttpRequest, but use attachEvent instead.
For IE8 and 9, in base_js.html.twig instead of
this.addEventListener("readystatechange", function() {
it should be
this.attachEvent("onreadystatechange", function () {
The text was updated successfully, but these errors were encountered: