Closed EmmanuelVella closed 10 years ago
i think at this point we cannot change it but we could offer a second routing xml file without locale ..?
Yes, or I can submit this PR against the master branch if you prefer.
i agree that we should not break this for existing versions. duplicating the file is a bit unlucky - would it work to provide {_locale} as prefix? then we could just document to include the file like that for multilang setups that use the locale from the path. we should probably change the file name at the same time, so that people see they need to check the changelog.
then again, this is just for rest calls right? sending the locale in the url again is a rather "hidden" issue and should have no potential for bugs.
Yes, this is just for rest calls.
My problem is that I just did a migration from locale prefixed routes (/{_locale}
) to localized domains, and I now redirect every URI starting with /{_locale}
to the corresponding domain. So now when calling the rest URLs to save content, it's also being redirected, breaking the edition.
I know I could add an "exception" in my redirections rules, but I think it's anyway cleaner to let the user choose if he wants to prefix or not these routes.
And yes prefixing the import with /{_locale}
works. I can add a note in the changelog and eventually rename the file if this solution is ok for you.
what I meant was .. your change is ok .. but do it in a file rest_no_locale.xml, and then change the existing one to load that one with a prefix for BC
@lsmith77 I didn't know that was possible, that's a great idea. I just updated my PR. Thanks !
looks good to me .. did someone test this in the sandbox? we can then merge it and tag 1.2.1
I tested it in my project by including the deprecated rest.xml file, it worked perfectly. Please notice that this PR is submitted on the 1.1 branch.
we will not do more releases on 1.1, so I will merge it into master then.
Ok, do you want me to create another PR on the master branch ?
seems like there are some merge conflicts .. can you rebase and create a new PR for master?
I opened a new PR here https://github.com/symfony-cmf/CreateBundle/pull/127
I think the
_locale
prefix should (or not) be set globally when importing therest.xml
file.I personnaly have one domain per locale so I don't need to prefix these routes.
If this PR is accepted, I will add the corresponding documentation.
BTW, I submit this PR against the 1.1 branch, hope it's ok !