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

refactor common features into RoutingBundle #98

Merged
merged 6 commits into from
Apr 3, 2014
Merged

Conversation

dbu
Copy link
Member

@dbu dbu commented Feb 14, 2014

Q A
Bug fix? no
New feature? yes
BC breaks? yes (small ones)
Deprecations? yes
Tests pass? not yet
Fixed tickets symfony-cmf/routing-bundle#210
License MIT
Doc PR TODO

adjust to symfony-cmf/routing-bundle#210

/**
* provides multi language support when using MultilangRouteProvider
*/
class MultilangRedirectRoute extends RedirectRoute
Copy link
Member Author

Choose a reason for hiding this comment

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

we need to note these in the Changelog and Upgrade and explain how to migrate, i guess. or did anybody ever even use these?

@dbu
Copy link
Member Author

dbu commented Mar 29, 2014

@lsmith77 can you review this one too? the BC stuff works to at least make the sandbox still happy. though as there are some BC issues anyways, i wonder if we can simply drop routing configuration from simple cms completely.

@dbu
Copy link
Member Author

dbu commented Mar 29, 2014

whats missing: update the PR on the docs again, and a small PR on CoreBundle to prepend the right paths.

@lsmith77
Copy link
Member

hmm would be easier to review such a PR with a branch of the sandbox that integrates all the changes

@dbu
Copy link
Member Author

dbu commented Mar 31, 2014

there you go symfony-cmf/cmf-sandbox#244

would be great to get some input. i will wrap up tonight and then we can
tag the RC

@lsmith77
Copy link
Member

PageAdmin needs to be adjusted to the options array

@lsmith77
Copy link
Member

how does the multilang support work now?

as soon as I add a locale to the page, it will add the /{_locale} bit to the route? (which is why we do not need the "add locale pattern" option?

@dbu
Copy link
Member Author

dbu commented Mar 31, 2014

either you manually (or maybe in the admin?) set the add_locale_pattern option, or you enable the auto_locale_pattern option on routing bundle. this is however global and will affect all routes, also those from other routes. though it should not affect routes that already have a locale in them, though that might still be incorrect.

{
public $node;
/**
Copy link
Member

Choose a reason for hiding this comment

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

generally i dont think we should map things like node and uuid by default. there is a bit of overhead involved and it exposes things that people on the ODM level should not worry about. then again, we already exposed this here before.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it would be a BC break to stop exposing it. but we can also remove
it, there is always getNodeByDocument on the documentmanager.

@dbu
Copy link
Member Author

dbu commented Apr 1, 2014

symfony 2.5 will probably fail until sonata-project/SonataAdminBundle#2027 is merged.

persistence:
phpcr:
route_basepaths:
- "/test/page"
Copy link
Member Author

Choose a reason for hiding this comment

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

this is actually a problem. we configure that path twice, once on simplecms and once on routing. when its the default path, the core bundle prepends it everywhere. but if we need something different, we duplicate the config. what could we do? could prepend configuration work in that case? what happens if the cmf_routing has route_basepaths configured, will the list be merged or replaced?

Copy link
Member Author

Choose a reason for hiding this comment

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

seems we already prepend a bit of config from simplecms to the routing, so if it works it would be no big deal.

@@ -32,9 +32,32 @@ class CmfSimpleCmsExtension extends Extension implements PrependExtensionInterfa
*/
public function prepend(ContainerBuilder $container)
{
$prependConfig = array('persistence' => array('phpcr' => (array('enabled' => true))));
$container->prependExtensionConfig('cmf_menu', $prependConfig);
$prependConfig = array('dynamic' => $prependConfig);
Copy link
Member Author

Choose a reason for hiding this comment

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

i remove this part as the corebundle already does it, and we depend on it

@dbu dbu changed the title WIP refactor common features into RoutingBundle refactor common features into RoutingBundle Apr 2, 2014
@dbu
Copy link
Member Author

dbu commented Apr 2, 2014

alright, i updated this and i think its ready now

@@ -45,7 +51,7 @@ public function testPage()
$page = new Page;
$refl = new \ReflectionClass($page);
Copy link
Member Author

Choose a reason for hiding this comment

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

@lsmith77 ok if we just drop this reflection stuff and use the normal way of creating a page through the dm?

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member

Choose a reason for hiding this comment

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

+1 this is really confusing code

@dbu
Copy link
Member Author

dbu commented Apr 3, 2014

okay, updated the test, should be good now. 2.5 will still fail as the PR on sonata admin is not merged yet.

@lsmith77
Copy link
Member

lsmith77 commented Apr 3, 2014

looks good .. but we probably need to bump the CoreBundle requirement

lsmith77 added a commit that referenced this pull request Apr 3, 2014
refactor common features into RoutingBundle
@lsmith77 lsmith77 merged commit d9ece63 into master Apr 3, 2014
@lsmith77 lsmith77 deleted the cleanup-routing branch April 3, 2014 10:03
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.

3 participants