-
Notifications
You must be signed in to change notification settings - Fork 80
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
Creating a new page on a sitetree which isnt the default locale adds faulty DB records. #156
Comments
fixed by 36c4125 |
This problem still exists, and breaks correct functioning of creation of pages in another anguage than the default one. A simple switch to an uppercase in TranslatableCMSMainExtension.php fixes it. Should i do a pull request? |
Hmm. I noticed this just now. I thought it had been working before but this issue suggests that it has been broken for a long time... What should be done? |
Can't reproduce with translatable 2.0.x-dev on SilverStripe 3.1.12: http://screencast.com/t/zLnW5Gjl. @jyrkij @hubertusanton Can you provide more details please? |
Tested this on 3.1.12 and translatable 2.0.6. It still occurs. I do the following steps (in your video you create pages on root, maybe thats the reason it works?) 1 - log into cms ( you end up in default lang tree ) This causes the bug: When you change ?locale= to ?Locale= which i do in all our projects by hand, its fixed. |
@hubertusanton Does this PR fix your issue? #193 |
@chillu Yes it does! Thanks! |
Causes inconsistent behaviour between form field name ("Locale") and view state in GET parameters ("Locale" and "locale"). Related to #156.
The following bug occurs after updating Translatable to the latest version:
When creating a new page under another on a language (right click) which is not the default, the page is created in the DB under the right parentID but is using the default locale. This results in the page being gone after reloading the backend.
Think this is caused by the changing of Locale to locale in TranslatableCMSMainExtension.php
on line 156
with Locale (translation added in nl_NL ok)
http://localhost/trtest/admin/pages/add/AddForm/?locale=nl_NL&Locale=nl_NL&action_doAdd=1&ParentID=6&PageType=Page&SecurityID=0a45efd7b7a64ceb7ffd56415ac99ee56828b3b2
with locale (translation not added in nl_NL but record created with wrong (default) locale on en_US )
http://localhost/trtest/admin/pages/add/AddForm/?locale=nl_NL&action_doAdd=1&ParentID=6&PageType=Page&SecurityID=0a45efd7b7a64ceb7ffd56415ac99ee56828b3b2
missing Locale (uppercase) in url so this is obviously used somewhere.
and this is in SS cms/code/controllers/CMSPageAddController.php at line 155
solving this might be in the cms or in translatable/code/controller/TranslatableCMSMainExtension.php
line 102
Not sure the solution is to just leave the variable starting in uppercase in my project in TranslatableCMSMainExtension.php on line 156, this might break something else? Will look into another solution later, hope someone knows the solution to this.
The text was updated successfully, but these errors were encountered: