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

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

Already on GitHub?Sign in to your account

Closed

Conversation

@dawehner
Copy link
Contributor

Let's assume you multiple lines of code calling toRequest::getRequestFormatproviding different default values.

$request->getRequestFormat();$request->getRequestFormat('json')

As of HEAD this causes the second call to return 'html', unless its set explicit viasetRequestFormat().

IMHO this is state which can be avoided.

Note: This also helps Drupal.

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?no
Fixed tickets
LicenseMIT
Doc PR

Koc, klausi, and ro0NL reacted with thumbs up emoji
@fabpot
Copy link
Member

LGTM, should be merged in 2.7 though (can you change the branch target of the PR?)

@nicolas-grekasnicolas-grekas added this to the2.7 milestoneMar 4, 2017
@nicolas-grekas
Copy link
Member

Thank you@dawehner.

nicolas-grekas added a commit that referenced this pull requestMar 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 getRequestFormatLet'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
@dawehner
Copy link
ContributorAuthor

@fabpot Sorry for not finding the time to update the PR
@nicolas-grekas Thank you for fixing it properly :)

This was referencedMar 6, 2017
danrot pushed a commit to sulu/sulu that referenced this pull requestMar 21, 2017
* Fix check in MarkupListenerAn update in Symfony has changed the way the request format is returned. Thishas 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 needsmore 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 requestMar 23, 2017
* Fix check in MarkupListenerAn update in Symfony has changed the way the request format is returned. Thishas 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 needsmore testing.Related change in Symfony:symfony/symfony#21805* Changelog update* added fix for BinaryFileResponse
@dominikzogg
Copy link

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 freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

6 participants

@dawehner@fabpot@nicolas-grekas@dominikzogg@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp