-
Notifications
You must be signed in to change notification settings - Fork 156
as the initializer is only run when sonata is present, ensure users create /cms/routes themselves #597
Conversation
lsmith77
commented
Oct 25, 2014
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'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…reate /cms/routes themselves
0fda9c8
to
d3c74f7
Compare
@@ -466,6 +467,8 @@ follows:: | |||
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given."); | |||
} | |||
|
|||
NodeHelper::createPath($session, '/cms/routes'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/routign/routing/
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. |
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 |
as the initializer is only run when sonata is present, ensure users create /cms/routes themselves
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicitly