-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Provide less state in getRequestFormat #21805
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LGTM, should be merged in 2.7 though (can you change the branch target of the PR?) |
Thank you @dawehner. |
nicolas-grekas
added a commit
that referenced
this pull request
Mar 4, 2017
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21805). Discussion ---------- Provide less state in getRequestFormat Let's assume you multiple lines of code calling to ```Request::getRequestFormat```providing different default values. ``` $request->getRequestFormat(); $request->getRequestFormat('json') ``` As of HEAD this causes the second call to return 'html', unless its set explicit via ```setRequestFormat()```. IMHO this is state which can be avoided. Note: This also helps Drupal. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | Commits ------- 1d43007 Provide less state in getRequestFormat
@fabpot Sorry for not finding the time to update the PR |
This was referenced Mar 6, 2017
Merged
Merged
Merged
danrot
pushed a commit
to sulu/sulu
that referenced
this pull request
Mar 21, 2017
* Fix check in MarkupListener An update in Symfony has changed the way the request format is returned. This has broken a check in the MarkupBundle and prevents it from running at all. Removing the 'null' parameter from the function call fixes the issue but needs more testing. Related change in Symfony: symfony/symfony#21805 * Changelog update * added fix for BinaryFileResponse
danrot
pushed a commit
to sulu/sulu
that referenced
this pull request
Mar 23, 2017
* Fix check in MarkupListener An update in Symfony has changed the way the request format is returned. This has broken a check in the MarkupBundle and prevents it from running at all. Removing the 'null' parameter from the function call fixes the issue but needs more testing. Related change in Symfony: symfony/symfony#21805 * Changelog update * added fix for BinaryFileResponse
please do not break things within bugfix releases, we need to provide content-type: application/json even on emtpy responses (i know its against the specs) but it sould be possible to do so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let's assume you multiple lines of code calling to
Request::getRequestFormat
providing different default values.As of HEAD this causes the second call to return 'html', unless its set explicit via
setRequestFormat()
.IMHO this is state which can be avoided.
Note: This also helps Drupal.