Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26679

Infinite spinning wheel if translating to a language with a big language code

    Details

    • Type: Bug Bug
    • Status: Confirmed
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 1.6.1, 1.7.0, 1.6.2, 1.7.1, 1.8.0, 1.7.2, 1.8.1, 1.9.0-rc
    • Fix Version/s: QA tracked issues
    • Labels:
    • Environment:

      Operating System: Debian 8
      PHP Version: 5.6.14-0+deb8u1
      Database and version: Mysql 5.5.46-0+deb8u1
      Browser (and version): Firefox 49
      Env: Prod

      Description

      In a translation, If I use a language that has a big language code, I have a infinite spinning whell when trying to publish the translated object

      Steps to Reproduce

      -Create a new language using "New language" as name and "aaaaaaaaaaaaaaaaaaaaaaaaaaa" as Language code
      -create one object (might be a folder) in english
      -Translate the created object to the newly created language
      -(open your browser developer tools)
      -Publish the object

      In here, we have a infinite spinning wheel and developer tools display the following error

      <?xml version="1.0" encoding="UTF-8"?>
      <ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml"><errorCode>404</errorCode><errorMessage
      >Not Found</errorMessage><errorDescription>Could not find 'Language' with identifier 'aaaaaaaaaaaaaaaaaaaaaaaaaaa'
      </errorDescription></ErrorMessage>
      

      Note:
      if we go to dashboard, the draft of the translated object that raised the error is there. If we edit the draft and publish it, the error no longer appear.

        Activity

        Hide
        Damien Pobel (Inactive) added a comment -

        I can't reproduce, when I tried to create the language with such a long code (first step), I got an error because the database is not able store such a long locale, the database field is limited to 20 characters. So I wonder how you could create one.

        Show
        Damien Pobel (Inactive) added a comment - I can't reproduce, when I tried to create the language with such a long code (first step), I got an error because the database is not able store such a long locale, the database field is limited to 20 characters. So I wonder how you could create one.
        Hide
        Rui Silva (Inactive) added a comment -

        [~damien.pobel@ez.no], I put in ordered attachments, what I see. The languages can be created with codes wider than 20 characters long but it seems they will afterwards be truncated to the twenty maximum character count, as I've tried now with a code "abcdefghijklmnopqrstuvwxyz" and it got truncated to "abcdefghijklmnopqrst".
        This seems to be the cause of the issue as, right after, I've tried creating a language with exactly twenty characters and the issue does not happen in that case.

        Show
        Rui Silva (Inactive) added a comment - [~damien.pobel@ez.no] , I put in ordered attachments, what I see. The languages can be created with codes wider than 20 characters long but it seems they will afterwards be truncated to the twenty maximum character count, as I've tried now with a code "abcdefghijklmnopqrstuvwxyz" and it got truncated to "abcdefghijklmnopqrst". This seems to be the cause of the issue as, right after, I've tried creating a language with exactly twenty characters and the issue does not happen in that case.
        Hide
        Paulo Nunes (Inactive) added a comment -

        Adding more information.
        I re-created the test and created a new language, using 20+ chars in the code. Right after creating the language, I go to "Administration dashboard / Languages / Language: MyLanguage" and I see the language code with all characters that I wrote.
        Then I create one object. When creating the translation on this new language, I have the referred error. Afterwards, If I go to "Administration dashboard / Languages / Language: MyLanguage" , the language code is now presented with only 20 characters (seems to have been truncated). From now on, I can create/translate objects at will, on this language, that the error doesn't present any longer.

        Show
        Paulo Nunes (Inactive) added a comment - Adding more information. I re-created the test and created a new language, using 20+ chars in the code. Right after creating the language, I go to "Administration dashboard / Languages / Language: MyLanguage" and I see the language code with all characters that I wrote. Then I create one object. When creating the translation on this new language, I have the referred error. Afterwards, If I go to "Administration dashboard / Languages / Language: MyLanguage" , the language code is now presented with only 20 characters (seems to have been truncated). From now on, I can create/translate objects at will, on this language, that the error doesn't present any longer.
        Hide
        Damien Pobel (Inactive) added a comment - - edited

        OK after investigating a bit, I think there are several things here:

        1. for the ability to create a language with a language code bigger than the MySQL column restriction, I think it's because you are not running MySQL in "strict mode" (see https://dev.mysql.com/doc/refman/5.6/en/char.html). Do we support such setup ? ping André Rømcke Bertrand Dunogier ?
        2. for the infinite loading screen, I think the fix EZP-26543 should also fix the infinite loading here and instead you should get a "proper" error notification

        So if I'm not mistaken on my second point, if we support MySQL not in "strict mode", the fix for this bug is to add some validation in the edit language form while if we don't support that setup the bug should be closed as "Cannot Reproduce" but we should create an Improvement add some nicer validation in the edit language form.

        So Paulo Nunes [~rui.silva@ez.no] could you retest with the fix for EZP-26543 and check the MySQL "strict mode" on your setup ?

        Show
        Damien Pobel (Inactive) added a comment - - edited OK after investigating a bit, I think there are several things here: for the ability to create a language with a language code bigger than the MySQL column restriction, I think it's because you are not running MySQL in "strict mode" (see https://dev.mysql.com/doc/refman/5.6/en/char.html ). Do we support such setup ? ping André Rømcke Bertrand Dunogier ? for the infinite loading screen, I think the fix EZP-26543 should also fix the infinite loading here and instead you should get a "proper" error notification So if I'm not mistaken on my second point, if we support MySQL not in "strict mode", the fix for this bug is to add some validation in the edit language form while if we don't support that setup the bug should be closed as "Cannot Reproduce" but we should create an Improvement add some nicer validation in the edit language form. So Paulo Nunes [~rui.silva@ez.no] could you retest with the fix for EZP-26543 and check the MySQL "strict mode" on your setup ?
        Hide
        André Rømcke added a comment - - edited

        > Do we support such setup ? ping André Rømcke Bertrand Dunogier ?

        So we clearly can't support something database (schema) does not, what we should do is:

        • Add validation of this field in repository (or rather in storage engine) to make sure it is something db can handle
        • Update doc

        As for strict mode, we can add Story to perhaps move towards running on that everywhere, bump requirements and somehow check it during install or using supports tools.

        Show
        André Rømcke added a comment - - edited > Do we support such setup ? ping André Rømcke Bertrand Dunogier ? So we clearly can't support something database (schema) does not, what we should do is: Add validation of this field in repository (or rather in storage engine) to make sure it is something db can handle Update doc As for strict mode, we can add Story to perhaps move towards running on that everywhere, bump requirements and somehow check it during install or using supports tools.

          People

          • Assignee:
            Unassigned
            Reporter:
            Paulo Nunes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: