Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

as the initializer is only run when sonata is present, ensure users create /cms/routes themselves #597

Merged
merged 3 commits into from
Oct 25, 2014

Conversation

lsmith77
Copy link
Member

Q A
Doc fix? yes
New docs? no
Applies to all
Fixed tickets symfony-cmf/standard-edition#23

throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
}

NodeHelper::createPath($session, '/cms/routes');
Copy link
Member

Choose a reason for hiding this comment

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

should we add a comment here that this is not needed when using sonata admin as there will be the initializer? otherwise people will just copy this line into their project and never understand they might not need it.

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 was pondering that too .. then again .. I feared that mentioning initializers or sonata here would be confusing

@lsmith77 lsmith77 force-pushed the ensure_cms_routes_is_created branch from 0fda9c8 to d3c74f7 Compare October 25, 2014 12:55
@@ -466,6 +467,8 @@ follows::
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
}

NodeHelper::createPath($session, '/cms/routes');
Copy link
Member

Choose a reason for hiding this comment

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

maybe have a comment here saying "or configure an initializer for this path", and a .. note:: after the code explaining that for routing, the routing initializer is only activated if a base path for sonata admin is configured, and link to the initializer and sonata docs.

i think not explaining what we do has more potential for confusion than linking the corresponding sections. a "note" to me means a reader can ignore it if it does not make sense to him.

Copy link
Member

Choose a reason for hiding this comment

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

I tried to make it more clear. Could you please verify the added text?


As you can see, the code explicitely creates the ``/cms/routes`` path.
The RoutingBundle only creates this path automatically if the Sonata Admin
was enabled in the routign configuration. Otherwise, it'll assume you
Copy link
Member

Choose a reason for hiding this comment

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

s/routign/routing/

@dbu
Copy link
Member

dbu commented Oct 25, 2014

btw, the reason for this is that routing can have several root paths configured, and if we create simple cms root with the routingbundle provider, this would lead to a problem. now with the priorities, we could actually make the simplecms initializer run before the routing one and fix this issue.

with sonata admin, we have a single base path for where routes are managed in sonata, and we initialize that path.

@wouterj
Copy link
Member

wouterj commented Oct 25, 2014

Thanks @dbu, now that I understand the use-case, I've improved the text a bit (including your great interlinking suggestion). I'll merge after Travis is green

wouterj added a commit that referenced this pull request Oct 25, 2014
as the initializer is only run when sonata is present, ensure users create /cms/routes themselves
@wouterj wouterj merged commit 5d96f9c into dev Oct 25, 2014
@wouterj wouterj deleted the ensure_cms_routes_is_created branch October 25, 2014 18:05
@@ -491,6 +494,15 @@ follows::
This will give you a document that matches the URL ``/projects/<number>`` but
also ``/projects`` as there is a default for the id parameter.

.. caution::

As you can see, the code explicitely creates the ``/cms/routes`` path.
Copy link
Member

Choose a reason for hiding this comment

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

explicitly

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

Successfully merging this pull request may close these issues.

4 participants