Skip to content

[WebProfilerBundle] Fix AJAX panel with fetch requests #20724

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

Closed
wants to merge 2 commits into from
Closed

[WebProfilerBundle] Fix AJAX panel with fetch requests #20724

wants to merge 2 commits into from

Conversation

OnekO
Copy link
Contributor

@OnekO OnekO commented Dec 2, 2016

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20723
License MIT
Doc PR None

FIX: Bug trying to use a Request object as an string, because window.fetch implementation doesn't support Request as param, always is expecting url and params object.
@stof
Copy link
Member

stof commented Dec 2, 2016

@OnekO I rebased your branch to base it on 3.2 rather than master, as you started the edition in master rather than your target branch.

@@ -243,6 +243,17 @@
var oldFetch = window.fetch;
window.fetch = function () {
var promise = oldFetch.apply(this, arguments);
var paramType = Object.prototype.toString.call(arguments[0]);
if (paramType === '[object Request]') {
arguments[0] = arguments[0].url;
Copy link
Member

Choose a reason for hiding this comment

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

we should not mutate arguments. It can cause issues. We should be using local variables instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I changed it again.

@OnekO
Copy link
Contributor Author

OnekO commented Dec 2, 2016

Thx :)

Using local variables instead mutating arguments.
@OnekO OnekO changed the title Patch 1 [WebProfilerBundle] Fix AJAX panel with fetch requests Dec 2, 2016
@nicolas-grekas nicolas-grekas added this to the 3.2 milestone Dec 6, 2016
@fabpot
Copy link
Member

fabpot commented Dec 13, 2016

Thank you @OnekO.

fabpot added a commit that referenced this pull request Dec 13, 2016
…ekO)

This PR was squashed before being merged into the 3.2 branch (closes #20724).

Discussion
----------

[WebProfilerBundle] Fix AJAX panel with fetch requests

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20723
| License       | MIT
| Doc PR        | None

Commits
-------

5527ee3 [WebProfilerBundle] Fix AJAX panel with fetch requests
@fabpot fabpot closed this Dec 13, 2016
@fabpot fabpot mentioned this pull request Dec 13, 2016
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
…sts (OnekO)

This PR was squashed before being merged into the 3.2 branch (closes symfony#20724).

Discussion
----------

[WebProfilerBundle] Fix AJAX panel with fetch requests

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#20723
| License       | MIT
| Doc PR        | None

Commits
-------

5527ee3 [WebProfilerBundle] Fix AJAX panel with fetch requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants