Jump to:

1161 Posts in 2632 Topics by 409 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Translation issue after upgrade 2.3.0-RC2 to 2.3.2-RC2

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1391 Views
  • jademonk
    Avatar
    Community Member
    4 Posts

    Translation issue after upgrade 2.3.0-RC2 to 2.3.2-RC2 Link to this post

    I have a site that is in English and French. I've recently upgraded from 2.3.0-RC2 to 2.3.2-RC2. I followed the instructions and ran the Migration script at the end of the upgrade. Admin works fine, and the English version of the site is intact. However...

    I can see that within the database that all the SiteTree_lang tables have been obsoleted and I can no longer use the ?lang=<lang> to access the translated fields for "_fr". The translated site into French no longer exists in the cms. In the database I can see that the fields are still there so my content isn't entirely missing. How do I reconnect all the French fields ( <field>_fr ) back into the cms? Is there a tanslatable table to map the FR locale back to those orphaned fields?

    thanks in advance!

  • jademonk
    Avatar
    Community Member
    4 Posts

    Re: Translation issue after upgrade 2.3.0-RC2 to 2.3.2-RC2 Link to this post

    So I tried to fix this problem on my own since I wasn't getting any help. I upgraded to the current stable release (2.3.2 stable). I followed the upgrade procedure. I deleted cms, sapphire, jsparty, and replaced them with their corresponding folders from the new version. I ran /dev/build and I ran the Migration script. However, even after putting

    Translatable::enable();
    Object::add_extension('SiteTree', 'Translatable');

    in my _config.php, I get an error when using Translatable::current_locale(). This is the error I receive.

    Fatal error: Call to undefined method Translatable::current_locale() in /webdocs/www/html/mysite/code/Page.php on line 117

    I've ran /dev/build to ensure that the database has been updated, but still no joy. I also noticed that I'm missing content/pages from the French translation. I suspect it had to do with the SiteTree_Lang table being obsoleted.

    All in all, the site is quite messed up, but I would appreciate some guidance.

    thanks

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Translation issue after upgrade 2.3.0-RC2 to 2.3.2-RC2 Link to this post

    Translatable is a mess in 2.3 .

    Have you tried to use i18n instead of translatable.

    I know it is depricated, but it works here better then the translatable class..

    i18n::enable();
    i18n::set_default_lang('nl');
    i18n::set_locale('nl_NL');

  • jademonk
    Avatar
    Community Member
    4 Posts

    Re: Translation issue after upgrade 2.3.0-RC2 to 2.3.2-RC2 Link to this post

    Translatable is indeed a mess. The new method Translatable::current_locale() that deprecated method Translatable::current_lang() in the online documentation (titled upgrading:2.3.2) doesn't work. I did however find that I can use Translatable::get_current_locale() in it's place. However, I'm experiencing a new problem. I had set the i18n defaults, and enabled Translatable as per the online docs; however in the CMS I get this error for all my SiteTree branches when selected:

    ERROR [Notice]: Object of class Page could not be converted to int
    IN POST /admin/getitem?ID=110&locale=en_US&ajax=1
    Line 22 in /www/mysite/html/sapphire/forms/LanguageDropdownField.

    I have corrected most of the code and have manually relinked lost database records orphaned by the MigrateTranslatableTasks script with a Perl script. I recaptured the French and English content for the site, and the code now abides by the new Translatable guidelines. I managed to get the multi-language published site working again, but the CMS is not functioning properly because of the above error when I select any branch. Occasionally I get an error, "Error Loading Subtree" when trying to expand a branch and the branch does not expand. The issue is not consistent, so it's difficult for me to troubleshoot. CMS seems to allow me to see page properties when the environment is set to Live, but in Dev mode, the error pop-up window appears with the above error.

    Can anyone help?

    1391 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.