Skip to content

[Routing] Revert the change in [#b42018] with respect to Routing/Route.php #23121

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 5 commits into from

Conversation

Gribnif
Copy link

@Gribnif Gribnif commented Jun 9, 2017

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21090 #23109
License MIT
Doc PR

...because it breaks BC with third-party code which, for instance, might use a subclass of CompiledRoute within the options portion of the Route. Refers to #21090 and #23109

@Gribnif Gribnif changed the title Revert the change in b4201810 with respect to Routing/Route.php [Routing] Revert the change in b4201810 with respect to Routing/Route.php Jun 9, 2017
@Gribnif Gribnif changed the title [Routing] Revert the change in b4201810 with respect to Routing/Route.php [Routing] Revert the change in [#b42018] with respect to Routing/Route.php Jun 9, 2017
@xabbuh xabbuh added this to the 3.3 milestone Jun 10, 2017
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Can you add a comment explaining why we cannot restrict the allowed classes in this case? And add a test to avoid any regression in the future?

@Gribnif
Copy link
Author

Gribnif commented Jun 12, 2017

As requested, I have amended the comment in the pull request and added a test. Let me know if you'd like anything else.

@@ -221,6 +221,21 @@ public function testSerializeWhenCompiled()
}

/**
* Tests that the compiled version does not fail when the Route refers to
* arbitrary classes.
Copy link
Member

Choose a reason for hiding this comment

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

Does not seem to be why we are doing it. We only want to ensure that the compiled route can be different from CompiledRoute, not that you can use any object on the route definition, which is not supported.


class CustomRouteCompiler extends RouteCompiler
{
/**
Copy link
Member

Choose a reason for hiding this comment

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

extra space

try {
$unserialized = unserialize($serialized);
$this->assertInstanceOf('\Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute', $unserialized->compile(), 'the unserialized route compiled successfully');
} catch (\Exception $except) {
Copy link
Member

Choose a reason for hiding this comment

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

should be $e

@fabpot
Copy link
Member

fabpot commented Jun 13, 2017

Thank you @Gribnif.

@fabpot fabpot closed this Jun 13, 2017
fabpot added a commit that referenced this pull request Jun 13, 2017
…outing/Route.php (Dan Wilga)

This PR was submitted for the master branch but it was merged into the 3.3 branch instead (closes #23121).

Discussion
----------

[Routing] Revert the change in [#b42018] with respect to Routing/Route.php

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

...because it breaks BC with third-party code which, for instance, might use a subclass of CompiledRoute within the options portion of the Route. Refers to #21090 and #23109

Commits
-------

f09893b [Routing] Revert the change in [#b42018] with respect to Routing/Route.php
@fabpot fabpot mentioned this pull request Jul 4, 2017
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.

4 participants