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

[Form] Outstanding patches for Choice/Collection fields#6

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
jmikola wants to merge0 commits intosymfony:masterfromjmikola:9aa6b6373a875b0a80484f92546eb88202349ef4
Closed

[Form] Outstanding patches for Choice/Collection fields#6

jmikola wants to merge0 commits intosymfony:masterfromjmikola:9aa6b6373a875b0a80484f92546eb88202349ef4

Conversation

jmikola
Copy link
Contributor

These commits were sitting around in a github convo I had months ago with Bernhard. I couldn't determine how to exclude certain commits from the pull request, but feel free to ignore:

The former ended up not being necessary and the latter appears to have been fixed by somone else since.

Let me know if you have any questions, thanks.

@jmikola
Copy link
ContributorAuthor

Please disregard this pull request, as their were irrelevant commits and other things were quite out of sync with the current master; made a newer one in:http://github.com/fabpot/symfony/pull/17

fabpot pushed a commit that referenced this pull requestNov 12, 2012
fabpot added a commit that referenced this pull requestNov 12, 2012
This PR was merged into the master branch.Commits-------17f51a1 Merge pull request#6 from Tobion/hostname-routese120a7a fix API of RouteCollection26e5684 some type fixes514e27a [Routing] fix PhpMatcherDumper that returned numeric-indexed params that are returned besides named placeholders by preg_match7ed3013 switch to array_replace instead of array_merge94ec653 removed irrelevant string case in XmlFileLoader9ffe3de synchronize the fixtures in different formats and fix default for numeric requirement6cd3457 fixed CS8366b8a [Routing] fixed validity check for hostname params in UrlGeneratora8ce621 [Routing] added support for hostname in the apache matcher dumper562174a [Routing] fixed indentation of dumped collections1489021 fixed CSa270458 [Routing] added some more unit tests153fcf2 [Routing] added some unit tests for the PHP loader68da6ad [Routing] added support for hostname in the XML loader3dfca47 [Routing] added some unit tests for the YAML loader92f9c15 [Routing] changed CompiledRoute signature to be more consistentd91e5a2 [Routing] fixed Route annotation for hostname (should be hostname_pattern instead of hostnamePattern)62de881 [Routing] clarified a variable content11b4378 [Routing] added hostname support in UrlMatcherfc015d5 [Routing] fixed route generation with a hostname pattern when the hostname is the same as the current one (no need to force the generated URL to be absolute)462999d [Routing] display hostname pattern in router:debug output805806a [Routing] added hostname matching support to UrlGenerator7a15e00 [Routing] added hostname matching support to AnnotationClassLoadercab450c [Routing] added hostname matching support to YamlFileLoader85d11af [Routing] added hostname matching support to PhpMatcherDumper402359b [Routing] added hostname matching support to RouteCompileradd3658 [Routing] added hostname matching support to Route and RouteCollection23feb37 [Routing] added hostname matching support to CompiledRouteDiscussion----------[2.2][Routing] hostname pattern for routesBug fix: noFeature addition: yesFixes the following tickets:#1762,#3276Backwards compatibility break: noSymfony2 tests pass: yesThis adds a hostname_pattern property to routes. It works like the pattern property (hostname_pattern can have variables, requirements, etc). The hostname_pattern property can be set on both routes and route collections.Yaml example:``` yaml# Setting the hostname_pattern for a whole collection of routesAcmeBundle:    resource: "@AcmeBundle/Controller/"    type: annotation    prefix: /    hostname_pattern: {locale}.example.com    requirements:        locale: en|fr# Setting the hostname_pattern for single routesome_route:    pattern: /hello/{name}    hostname_pattern: {locale}.example.com    requirements:        locale: en|fr        name: \w+    defaults:        _controller: Foo:bar:baz```Annotations example:``` php<?php/** * Inherits requirements and hostname pattern from the collection *@route("/foo") */public function fooAction();/** * Set a specific hostnamePattern for this route only *@route("/foo", hostnamePattern="{_locale}.example.com", requirements={"_locale="fr|en"}) */public function fooAction();```Performance:Consecutive routes with the same hostname pattern are grouped, and a single test is made against the hostname for this group, so the overhead is very low:```@route("/foo", hostnamePattern="a.example.com")@route("/bar", hostnamePattern="a.example.com")@route("/baz", hostnamePattern="b.example.com")```is compiled like this:```if (hostname matches a.example.com) {    // test route "/foo"    // test route "/bar"}if (hostname matches b.example.com) {    // test route "/baz"}```The PR also tries harder to optimize routes sharing the same prefix:```@route("/cafe")@route("/cacao")@route("/coca")```is compiled like this:```if (url starts with /c) {    if (url starts with /ca) {        // test route "/cafe"        // test route "/cacao"    }    // test route "/coca"}```---------------------------------------------------------------------------by Koc at 2012-02-16T14:14:19ZInteresting. Have you looked at#3057,#3002?Killer feature of#3057 : multiple hostnames per route.---------------------------------------------------------------------------by arnaud-lb at 2012-02-16T14:21:28Z@Koc yes, the main difference is that this PR allows variables in the hostname pattern, with requirements, etc just like the path pattern. The other PRs use a `_host` requirement, which works like the `_method` requirement (takes a list of allowed hostnames separated by `|`).> Killer feature of#3057 : multiple hostnames per route.If you have multiple tlds you can easily do it like this:``` yamlhostbased_route:  pattern:  /  hostname_pattern: symfony.{tld}  requirements:     tld: org|com```Or with completely different domain names:``` yamlhostbased_route:  pattern:  /  hostname_pattern: {domain}  requirements:     domain: example\.com|symfony\.com```Requirements allow DIC %parameters%, so you can also put you domains in your config.yml.---------------------------------------------------------------------------by Koc at 2012-02-16T15:52:16Zwow, nice! So looks like this PR closes my#3276 ticket?---------------------------------------------------------------------------by arnaud-lb at 2012-02-16T15:53:55ZYes, apparently :)---------------------------------------------------------------------------by Koc at 2012-02-16T15:56:53ZI cann't find method `ParameterBag::resolveValue` calling in this PR, like herehttps://github.com/symfony/symfony/pull/3316/files---------------------------------------------------------------------------by arnaud-lb at 2012-02-16T16:03:48ZI think it's in core already---------------------------------------------------------------------------by Koc at 2012-02-16T16:11:38Zlooks like yeshttps://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php#L81---------------------------------------------------------------------------by dlsniper at 2012-02-16T19:37:57ZThis PR looks great, it's something like this I've been waiting for.I know@fabpot said he's working on something similar but I think if he agrees with this it could be a great addition to the core.@fabpot ,@stof any objections about this PR if gets fully done?---------------------------------------------------------------------------by stof at 2012-02-16T20:00:21ZWell, we already have 2 other implementations for this stuff in the PRs.@fabpot please take time to look at them---------------------------------------------------------------------------by stof at 2012-02-16T20:03:17ZThis one is absolutely not tested and seems to break the existing tests according to the description. So it cannot be reviewed as is.---------------------------------------------------------------------------by dlsniper at 2012-02-16T22:00:24Z@stof I understand it's a WIP but the other PRs where ignored as well and like you've said, there's a bunch of PRs already on this issue all doing a thing or another. So an early feedback on this, or any other, could lead it to the right path in order to finally solve this issue.---------------------------------------------------------------------------by arnaud-lb at 2012-02-17T23:57:28ZAdded tests; others are passing now---------------------------------------------------------------------------by arnaud-lb at 2012-02-22T21:10:20ZI'm going to add support for the Apache dumper and the XML loader; does this PR have a chance to be merged ? cc@fabpot@stof---------------------------------------------------------------------------by stof at 2012-02-22T22:05:23Z@arnaud-lb We need to wait@fabpot's mind about the way he prefers to implement it to know which one can be merged.---------------------------------------------------------------------------by IjinPL at 2012-02-27T02:01:57ZForked@arnaud-lb *hostname_pattern* to add XML parasing support.---------------------------------------------------------------------------by stof at 2012-04-03T23:59:12Z@arnaud-lb Please rebase your branch. It conflicts with master because of the move of the tests@fabpot@vicb ping---------------------------------------------------------------------------by dlsniper at 2012-04-13T19:52:23ZHi,If@arnaud-lb won't be able to rebase this I could help with some work on this but there's still the problem of actually choosing the right PR(s) for this issue.@blogsh says in his last commit that this PR is a bit better in his opinion but@fabpot needs to decide in the end.---------------------------------------------------------------------------by arnaud-lb at 2012-04-14T17:26:55Z@stof rebased---------------------------------------------------------------------------by nomack84 at 2012-04-20T13:01:00Z@fabpot Any final word about this pull request? It would be nice to have this feature ready for 2.1.---------------------------------------------------------------------------by asm89 at 2012-04-24T21:27:50ZUsing the `{_locale}` placeholder in the host would set the locale for the request just like it does now?Another thing I'm wondering is how/if it should be possible to set the hostname pattern for all your routes, or at least when importing routes? Otherwise you'll end up repeating the same host pattern over and over again. I think this is also important when importing routes from third party bundles.---------------------------------------------------------------------------by fabpot at 2012-04-25T01:17:51ZI'm reviewing this PR and I'm going to make some modifications. I will send a PR to@arnaud-lb soon.---------------------------------------------------------------------------by fabpot at 2012-04-25T03:10:18ZI've sent a PR to@arnaud-lbarnaud-lb#3 that fixes some minor bugs and add support in more classes.---------------------------------------------------------------------------by fabpot at 2012-04-25T03:12:52Z@asm89:Placeholders in the hostname are managed in the same way as the ones from the URL pattern.You can set a hostname pattern for a collection (like the prefix for URL patterns).---------------------------------------------------------------------------by Tobion at 2012-04-25T09:31:19ZI think we need to change the contents of $variables, $tokens, and $hostnameTokens in the CompiledRoute. They contain redundant information and the content structure of these variables ist not documentation in any way. If we remove duplicated content and put it in a (single) well defined variable, it would also reduce the information that need to be saved in the generated class by the UrlGeneratorDumper.---------------------------------------------------------------------------by arnaud-lb at 2012-04-26T08:54:21Z@fabpot thanks :) I've merged it---------------------------------------------------------------------------by stof at 2012-04-26T12:08:40ZA rebase is needed---------------------------------------------------------------------------by fabpot at 2012-04-26T13:28:08Zno need to rebase, I will resolve the conflicts when merging. I've still have some minor changes to do before merging though. Anyone willing to have a look at implementing the Apache dumper part?---------------------------------------------------------------------------by Tobion at 2012-04-26T14:59:00Z@fabpot you want to merge this for 2.1 although it introduces big changes that need extensive review and testing? But#3958 is not considered for 2.1? I thought we are in some sort of feature freeze for the components in order to not postpone the release.---------------------------------------------------------------------------by fabpot at 2012-04-26T17:21:09Z@Tobion: I never said it will be in 2.1. The plan is to create a 2.1 branch soon so that we can continue working on 2.2.---------------------------------------------------------------------------by Koc at 2012-04-26T19:46:43Zhttps://twitter.com/#!/fabpot/status/178502663690915840
nicolas-grekas added a commit that referenced this pull requestNov 27, 2015
…ion on-demand (nicolas-grekas)This PR was merged into the 2.8 branch.Discussion----------[Bridge\PhpUnit] Display the stack trace of a deprecation on-demand| Q             | A| ------------- | ---| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -This PR has been essential into making#16708, and I think everyone working on a 3.0 migration will need this.Example:```$ SYMFONY_DEPRECATIONS_HELPER=/FormExtensionBootstrap3LayoutTest/ ./phpunit src/Symfony/Bridge/Twig/PHPUnit 4.8.18 by Sebastian Bergmann and contributors.Testing src/Symfony/Bridge/Twig/................................................Remaining deprecation triggered by Symfony\Bridge\Twig\Tests\Extension\FormExtensionBootstrap3LayoutTest::testSingleChoiceGrouped:The value "false" for the "choices_as_values" option is deprecated since version 2.8 and will not be supported anymore in 3.0. Set this option to "true" and flip the contents of the "choices" option instead.Stack trace:#0 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(286): trigger_error()#1 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}()#2 src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php(277): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet()#3 src/Symfony/Component/OptionsResolver/OptionsResolver.php(962): Symfony\Component\Form\Extension\Core\Type\ChoiceType->Symfony\Component\Form\Extension\Core\Type\{closure}()#4 src/Symfony/Component/OptionsResolver/OptionsResolver.php(791): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet()#5 src/Symfony/Component/Form/ResolvedFormType.php(156): Symfony\Component\OptionsResolver\OptionsResolver->resolve()#6 src/Symfony/Component/Form/FormFactory.php(119): Symfony\Component\Form\ResolvedFormType->createBuilder()#7 src/Symfony/Component/Form/FormFactory.php(48): Symfony\Component\Form\FormFactory->createNamedBuilder()#8 src/Symfony/Component/Form/Tests/AbstractBootstrap3LayoutTest.php(540): Symfony\Component\Form\FormFactory->createNamed()#9 [internal function]: Symfony\Component\Form\Tests\AbstractBootstrap3LayoutTest->testSingleChoiceGrouped()#10 {main}KO src/Symfony/Bridge/Twig/```Commits-------5a88fb6 [Bridge\PhpUnit] Display the stack trace of a deprecation on-demand
derrabus added a commit that referenced this pull requestDec 1, 2020
This PR was merged into the 5.1 branch.Discussion----------[String] Fix Notice when argument is empty string| Q             | A| ------------- | ---| Branch?       | 5.1 <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| License       | MITPHP Notice is generated when we pass empty string to `singularize` or `pluralize` method.```$inflector = new \Symfony\Component\String\Inflector\EnglishInflector();$inflector->singularize('');``````Notice: Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344PHP Notice:  Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344``````$inflector = new \Symfony\Component\String\Inflector\EnglishInflector();$inflector->pluralize('');``````Notice: Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 424PHP Notice:  Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 424```**Background**:When `\Symfony\Component\PropertyAccess\PropertyAccessorInterface::setValue` is used with `_` property, then it calls \Symfony\Component\String\Inflector\EnglishInflector::singularize with empty string.```class Check{    public $_;}$check = new Check();$pr = PropertyAccess::createPropertyAccessorBuilder()    ->getPropertyAccessor();if($pr->isWritable($check, '_')){    $pr->setValue($check, '_', 'test');}var_dump($check);``````Notice: Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344PHP Notice:  Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344...Notice: Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344PHP Notice:  Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344Notice: Uninitialized string offset: 0 in vendor/symfony/string/Inflector/EnglishInflector.php on line 344object(Check)#6 (1) {  ["_"]=>  string(4) "test"}```P.S.Another solution is to include empty string in \Symfony\Component\String\Inflector\EnglishInflector::$uninflected```    private static $uninflected = [        '',        'atad',        'reed',        'kcabdeef',        'hsif',        'ofni',        'esoom',        'seires',        'peehs',        'seiceps',    ];```If this PR is not relevant please close and sorry for inconvenience.Commits-------88c2b9b [String] Fix Notice when argument is empty string
OskarStark pushed a commit to PGLongo/symfony that referenced this pull requestDec 22, 2020
# Das ist die erste Commit-Beschreibung:[Notifier] add support for gatewayapi-notifier# Die Commit-Beschreibungsymfony#2 wird ausgelassen:# Make GatewayAPITransportFactory final# Die Commit-Beschreibungsymfony#3 wird ausgelassen:# Fix typo in gatewaypi# Die Commit-Beschreibungsymfony#4 wird ausgelassen:# Fix typo# Die Commit-Beschreibungsymfony#5 wird ausgelassen:# Update README.md# Die Commit-Beschreibungsymfony#6 wird ausgelassen:# Rename GatewayAPI -> GatewayApi# Die Commit-Beschreibungsymfony#7 wird ausgelassen:# Add GatewayApiTransportFactory tests# Die Commit-Beschreibungsymfony#8 wird ausgelassen:# Add GatewayApiTransportTest testSend# Die Commit-Beschreibungsymfony#9 wird ausgelassen:# Add GatewayApiTransportTest testSupportsSmsMessage# Die Commit-Beschreibungsymfony#10 wird ausgelassen:# Add GatewayApiTransportTest testNotSupportsChatMessage# Die Commit-Beschreibungsymfony#11 wird ausgelassen:# Lint code# Die Commit-Beschreibungsymfony#12 wird ausgelassen:# Fix name and email in composer.json## Co-authored-by: Tobias Nyholm <tobias.nyholm@gmail.com># Die Commit-Beschreibungsymfony#13 wird ausgelassen:# Remove extra from composer.json# Die Commit-Beschreibungsymfony#14 wird ausgelassen:# Update version tag in GatewayApiTransport# Die Commit-Beschreibungsymfony#15 wird ausgelassen:# Add /.gitattributes export-ignore in .gitattributes# Die Commit-Beschreibungsymfony#16 wird ausgelassen:# Update UnsupportedSchemeException# Die Commit-Beschreibungsymfony#17 wird ausgelassen:# Add required space in phpdoc# Die Commit-Beschreibungsymfony#18 wird ausgelassen:# Update GatewayApiTransportFactory.php## Update version tag in GatewayApiTransportFactory# Die Commit-Beschreibungsymfony#19 wird ausgelassen:# [Notifier] add support for gatewayapi-notifier# Die Commit-Beschreibungsymfony#20 wird ausgelassen:# Make GatewayAPITransportFactory final# Die Commit-Beschreibungsymfony#21 wird ausgelassen:# Make GatewayAPITransportFactory final# Die Commit-Beschreibungsymfony#22 wird ausgelassen:# Fix typo in gatewaypi# Die Commit-Beschreibungsymfony#23 wird ausgelassen:# Fix typo# Die Commit-Beschreibungsymfony#24 wird ausgelassen:# Update README.md
wouterj added a commit that referenced this pull requestFeb 19, 2021
This PR was merged into the 5.3-dev branch.Discussion----------[Security] Added debug:firewall command| Q             | A| ------------- | ---| Branch?       | 5.x| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       |Fix#39321| License       | MIT| Doc PR        |symfony/symfony-docs#14982| Tags | #SymfonyHackday### Subtasks- [x] Add list view (for use without arguments)- [x] Add more information to list view- [x] Add detail view (for use with `firewall` argument)- [x] Add more information to detail view table- [x] Add authenticators list- [x] Add event listeners & events (copy from `debug:event-listener`)- [x] Add `--include-listeners` option (default: false)- [x] Add helptext- [x] Add documentation### Moved outside of current scope- Add allowed badges### Usage (and example output) for a list`bin/console debug:firewall````Firewalls========= The following firewalls are defined: --------  Name --------  dev  public  main -------- // To view details of a specific firewall, re-run this command with a firewall name. (e.g. debug:firewall // main)```### Usage (and example output) for details`bin/console debug:firewall main````Firewall "main"=============== ----------------------- ---------------------------------------------------  Option                  Value ----------------------- ---------------------------------------------------  Name                    main  Context                 main  Lazy                    Yes  Stateless               No  User Checker            security.user_checker  Provider                security.user.provider.concrete.app_user_provider  Entry Point             App\Security\LoginFormAuthenticator  Access Denied URL  Access Denied Handler ----------------------- ---------------------------------------------------User switching-------------- ----------- ---------------------------------------------------  Option      Value ----------- ---------------------------------------------------  Parameter   test  Provider    security.user.provider.concrete.app_user_provider  User Role   ROLE_SWITCH_POSSIBLE ----------- ---------------------------------------------------Event listeners for firewall "main"==================================="Symfony\Component\Security\Http\Event\LoginSuccessEvent" event--------------------------------------------------------------- ------- -------------------------------------------------------------------------------------------- ----------  Order   Callable                                                                                     Priority ------- -------------------------------------------------------------------------------------------- ----------#1      Symfony\Component\Security\Http\EventListener\UserCheckerListener::postCheckCredentials()    256#2      Symfony\Component\Security\Http\EventListener\SessionStrategyListener::onSuccessfulLogin()   0#3      Symfony\Component\Security\Http\EventListener\RememberMeListener::onSuccessfulLogin()        0#4      App\Security\UpdateLastLogin::__invoke()                                                     0#5      Symfony\Component\Security\Http\EventListener\PasswordMigratingListener::onLoginSuccess()    0 ------- -------------------------------------------------------------------------------------------- ----------"Symfony\Component\Security\Http\Event\LogoutEvent" event--------------------------------------------------------- ------- ------------------------------------------------------------------------------------------- ----------  Order   Callable                                                                                    Priority ------- ------------------------------------------------------------------------------------------- ----------#1      Symfony\Component\Security\Http\EventListener\DefaultLogoutListener::onLogout()             64#2      Symfony\Component\Security\Http\EventListener\SessionLogoutListener::onLogout()             0#3      Symfony\Component\Security\Http\EventListener\RememberMeLogoutListener::onLogout()          0#4      Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener::onLogout()   0 ------- ------------------------------------------------------------------------------------------- ----------"Symfony\Component\Security\Http\Event\CheckPassportEvent" event---------------------------------------------------------------- ------- ------------------------------------------------------------------------------------------ ----------  Order   Callable                                                                                   Priority ------- ------------------------------------------------------------------------------------------ ----------#1      Symfony\Component\Security\Http\EventListener\LoginThrottlingListener::checkPassport()     2080#2      Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport()        2048#3      Symfony\Component\Security\Http\EventListener\UserProviderListener::checkPassport()        1024#4      Symfony\Component\Security\Http\EventListener\CsrfProtectionListener::checkPassport()      512#5      Symfony\Component\Security\Http\EventListener\UserCheckerListener::preCheckCredentials()   256#6      App\Security\DisallowBannedUsers::__invoke()                                               0#7      Symfony\Component\Security\Http\EventListener\CheckCredentialsListener::checkPassport()    0 ------- ------------------------------------------------------------------------------------------ ----------"Symfony\Component\Security\Http\Event\LoginFailureEvent" event--------------------------------------------------------------- ------- ----------------------------------------------------------------------------------- ----------  Order   Callable                                                                            Priority ------- ----------------------------------------------------------------------------------- ----------#1      Symfony\Component\Security\Http\EventListener\RememberMeListener::onFailedLogin()   0 ------- ----------------------------------------------------------------------------------- ----------Authenticators for firewall "main"================================== //@todo: List authenticator information```Commits-------a9dea1d [Security] Added debug:firewall command
@remco-pcremco-pc mentioned this pull requestJun 16, 2023
chalasr added a commit that referenced this pull requestMar 5, 2024
…lishing a message. (jwage)This PR was squashed before being merged into the 6.4 branch.Discussion----------[Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        |Fix#36538Fix#48241| License       | MITIf you have a message handler that dispatches messages to another queue, you can encounter `AMQPConnectionException` with the message "Library error: a SSL error occurred" or "a socket error occurred"  depending on if you are using tls or not or if you are running behind a load balancer or not.You can manually reproduce this issue by dispatching a message where the handler then dispatches another message to a different queue, then go to rabbitmq admin and close the connection manually, then dispatch another message and when the message handler goes to dispatch the other message, you will get this exception:```a socket error occurred#0 /vagrant/vendor/symfony/amqp-messenger/Transport/AmqpTransport.php(60): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender->send()#1 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(62): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransport->send()#2 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle()#3 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(61): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle()#4 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle()#5 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle()#6 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle()#7 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle()#8 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch()#9 /vagrant/src/Messenger/MessageBus.php(37): Symfony\Component\Messenger\TraceableMessageBus->dispatch()#10 /vagrant/vendor/symfony/mailer/Mailer.php(66): App\Messenger\MessageBus->dispatch()#11 /vagrant/src/Mailer/Mailer.php(83): Symfony\Component\Mailer\Mailer->send()#12 /vagrant/src/Mailer/Mailer.php(96): App\Mailer\Mailer->send()#13 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(118): App\Mailer\Mailer->sendEmail()#14 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(72): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->handle()#15 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(152): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->__invoke()#16 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(91): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->callHandler()#17 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(71): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->handle()#18 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle()#19 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(68): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle()#20 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle()#21 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle()#22 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle()#23 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle()#24 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch()#25 /vagrant/vendor/symfony/messenger/RoutableMessageBus.php(54): Symfony\Component\Messenger\TraceableMessageBus->dispatch()#26 /vagrant/vendor/symfony/messenger/Worker.php(162): Symfony\Component\Messenger\RoutableMessageBus->dispatch()#27 /vagrant/vendor/symfony/messenger/Worker.php(109): Symfony\Component\Messenger\Worker->handleMessage()#28 /vagrant/vendor/symfony/messenger/Command/ConsumeMessagesCommand.php(238): Symfony\Component\Messenger\Worker->run()#29 /vagrant/vendor/symfony/console/Command/Command.php(326): Symfony\Component\Messenger\Command\ConsumeMessagesCommand->execute()#30 /vagrant/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run()#31 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(126): Symfony\Component\Console\Application->doRunCommand()#32 /vagrant/vendor/symfony/console/Application.php(324): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand()#33 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(80): Symfony\Component\Console\Application->doRun()#34 /vagrant/vendor/symfony/console/Application.php(175): Symfony\Bundle\FrameworkBundle\Console\Application->doRun()#35 /vagrant/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php(49): Symfony\Component\Console\Application->run()#36 /vagrant/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run()#37 /vagrant/bin/console(11): require_once('...')#38 {main}```TODO:- [x] Add test for retry logic when publishing messagesCommits-------f123370 [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
xabbuh added a commit that referenced this pull requestAug 12, 2024
This PR was merged into the 5.4 branch.Discussion----------[Yaml] 🐛 throw ParseException on invalid date| Q             | A| ------------- | ---| Branch?       | 5.4 <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Issues        | None <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->| License       | MIT(found insymfony-tools/docs-builder#179)When parsing the following yaml:```date: 6418-75-51````symfony/yaml` will throw an exception:```$ php main.phpPHP Fatal error:  Uncaught Exception: Failed to parse time string (6418-75-51) at position 6 (5): Unexpected character in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php:714Stack trace:#0 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(714): DateTimeImmutable->__construct()#1 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(312): Symfony\Component\Yaml\Inline::evaluateScalar()#2 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(80): Symfony\Component\Yaml\Inline::parseScalar()#3 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(790): Symfony\Component\Yaml\Inline::parse()#4 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(341): Symfony\Component\Yaml\Parser->parseValue()#5 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(86): Symfony\Component\Yaml\Parser->doParse()#6 /tmp/symfony-yaml/vendor/symfony/yaml/Yaml.php(77): Symfony\Component\Yaml\Parser->parse()#7 /tmp/symfony-yaml/main.php(8): Symfony\Component\Yaml\Yaml::parse()#8 {main}  thrown in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php on line 714```This is because the "month" is invalid. Fixing the "month" will trigger about the same issue because the "day" would be invalid.With the current change it will throw a `ParseException`.Commits-------6d71a7e 🐛 throw ParseException on invalid date
stobrien89 pushed a commit to stobrien89/symfony that referenced this pull requestFeb 27, 2025
This pull request wasclosed.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@jmikola

[8]ページ先頭

©2009-2025 Movatter.jp