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

TextLine fieldtype string length validator does not work correctly with multibyte characters

    Details

      Description

      Validation needs to use mb_* functions.

        Activity

        Hide
        Bertrand Dunogier added a comment -

        Paulo Nunes could you have a scenario established for this use-case, and verify that it still occurs ? Thank you.

        Show
        Bertrand Dunogier added a comment - Paulo Nunes could you have a scenario established for this use-case, and verify that it still occurs ? Thank you.
        Hide
        Rui Silva (Inactive) added a comment -

        QA has tested this on an updated master, and the issue occurred by running the following use-case:

        1. Go to platform ui admin interface, to "Admin -> Content Types";
        2. Enter Content Type Group "Content";
        3. Inside, create a content type with the following specs:
        Name: MB
        Identifier: mb
        Fields:
        Type: Text Line
        Name: Name
        Identifier: name
        Type: Text Line
        Name: MB
        Identifier: mb
        Maximum length: 2
        4. Under home content "eZ Platform", create a content of this new content type "MB", and on its MB field, insert:
        とう
        click save, and verify you will get a notification:
        An error occurred while publishing the draft
        and an inline form notice:
        The string can not exceed 2 characters.

        Show
        Rui Silva (Inactive) added a comment - QA has tested this on an updated master, and the issue occurred by running the following use-case: 1. Go to platform ui admin interface, to "Admin -> Content Types"; 2. Enter Content Type Group "Content"; 3. Inside, create a content type with the following specs: Name: MB Identifier: mb Fields: Type: Text Line Name: Name Identifier: name Type: Text Line Name: MB Identifier: mb Maximum length: 2 4. Under home content "eZ Platform", create a content of this new content type "MB", and on its MB field, insert: とう click save, and verify you will get a notification: An error occurred while publishing the draft and an inline form notice: The string can not exceed 2 characters.
        Hide
        Philipp Bohnenstengel added a comment - - edited

        This does not only occur for non latin languages but also for certain typographic characters like en dash and em dash . en dash is actually sometimes used by our customer in headlines which do have a character limit (for seo)

        I suppose this has to do with unicode character encoding because when I remove the limitation the api response looks like this for an en dash:

        "field": [
            {
                "id": 37254,
                "fieldDefinitionIdentifier": "new_ezstring_1",
                "languageCode": "ger-DE",
                "fieldValue": "\u2013"
            }
        ]
        

        also, the "affects version" field of this issue should be updated to 1.6.1

        Show
        Philipp Bohnenstengel added a comment - - edited This does not only occur for non latin languages but also for certain typographic characters like en dash – and em dash — . en dash is actually sometimes used by our customer in headlines which do have a character limit (for seo) I suppose this has to do with unicode character encoding because when I remove the limitation the api response looks like this for an en dash: "field": [ { "id": 37254, "fieldDefinitionIdentifier": "new_ezstring_1", "languageCode": "ger-DE", "fieldValue": "\u2013" } ] also, the "affects version" field of this issue should be updated to 1.6.1
        Hide
        Philipp Bohnenstengel added a comment -

        this should be marked as fixed, because it is the same as EZP-27876

        Show
        Philipp Bohnenstengel added a comment - this should be marked as fixed, because it is the same as EZP-27876

          People

          • Assignee:
            Unassigned
            Reporter:
            Petar Spanja (Inactive)
          • Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: