Skip to content
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

Deprecation error handling #2491

Merged
merged 4 commits into from Jun 11, 2015
Merged

Deprecation error handling #2491

merged 4 commits into from Jun 11, 2015

Conversation

Guite
Copy link
Member

@Guite Guite commented Jun 10, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
Refs tickets #2486
License MIT
Doc PR -
Changelog updated no

@Guite Guite added this to the 1.4.0 milestone Jun 10, 2015
@Guite
Copy link
Member Author

Guite commented Jun 10, 2015

Collecting related issues in vendor bundles here:

FriendsOfSymfony/FOSJsRoutingBundle#196

@Guite
Copy link
Member Author

Guite commented Jun 10, 2015

I think that some deprecated route information comes from the database (zikula_routes_route table).

Example content for the methods field:

a:1:{i:0;s:3:"GET";}

Example content for the requirements field:

a:1:{s:7:"_method";s:3:"GET";}

Whereby the second parameter is deprecated.

@cmfcmf How to handle that?

@Guite Guite changed the title [WIP] Deprecation error handling Deprecation error handling Jun 11, 2015
@Guite
Copy link
Member Author

Guite commented Jun 11, 2015

@cmfcmf and I looked at this during the last hour. We did some minor refactorings in order to do what is possible.
One thing which is outside of our area is the _method depreciation warning. This is caused by Symfony itself, see https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Routing/Route.php#L307

Guite added a commit that referenced this pull request Jun 11, 2015
Deprecation error handling
@Guite Guite merged commit e35dc17 into zikula:1.4 Jun 11, 2015
@Guite
Copy link
Member Author

Guite commented Jun 12, 2015

@craigh http://symfony.com/blog/symfony-2-7-1-released

bug #14900 Silence deprecation warnings by default (reecefowell)

@craigh
Copy link
Member

craigh commented Jun 12, 2015

see comment in slack.

@weaverryan
Copy link

I'm not convinced that the code in Route.php is responsible for the deprecated warnings about _method. _method is being added to the requirements property, but sanitizeRequirement() is never called for it (sanitizeRequirement() is only called when you actually add a requirement via the public method). Even if you serialized the route and deserialized it, you'd end up with the same Route object, still without sanitizeRequirement() bing called on the _method.

I don't know how the zikula_routes_route table is populated exactly, but if a Symfony Route object is used to populate it, then later the data in zikula_routes_route is used to re-create a Symfony Route object, then you probably would be calling Route::setRequirements(), which would trigger the warning. But if that's the case, you should be able to filter the _method out before it's saved into the database.

I hope that helps!

@Guite
Copy link
Member Author

Guite commented Jun 16, 2015

Thanks @weaverryan for your explaination.
I guess that https://github.com/zikula/core/blob/1.4/src/system/ZikulaRoutesModule/Routing/RouteLoader.php#L85 could be the problem then.

@cmfcmf what do you think?

@cmfcmf
Copy link
Contributor

cmfcmf commented Jun 16, 2015

Yes @Guite, this probably is it.

@cmfcmf
Copy link
Contributor

cmfcmf commented Jun 16, 2015

The thing @weaverryan suggested has now been added in #2498.

@craigh
Copy link
Member

craigh commented Jun 16, 2015

THANK YOU @weaverryan for taking the time to help us! (conversation began here)

@weaverryan
Copy link

Cheers! Happy to be able to help out another library in the ecosystem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants