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

String length validation error contains %-symbols

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      Example: The string can not exceed %42% characters. - the %'s shouldn't be there. The translation parameters are not %-wrapped, which means the %'s that exist in the translation string won't be removed when parameters are inserted.

      These strings end up in the Symfony Translator which uses http://php.net/manual/en/function.strtr.php and that makes no assumptions about %'s, it simply replaces strings verbatim. So if strings are %-wrapped in the translation string, they must also be so in the parameters: http://symfony.com/doc/2.7/components/translation/usage.html#message-placeholders

      The kernel fix for this triggers an error in repository-forms, which does automatic %-wrapping. The repository-forms PR fixes this.

      STEPS TO REPRODUCE (REST):

      • Use a content type with a textline that has min/max length set
      • Using REST, create a content of this type, submitting a string of invalid length for the textline
      • See that the error message in the REST response has %'s around the integer value

      STEPS TO REPRODUCE (REPOSITORY-FORMS)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gunnstein.lye@ez.no Gunnstein Lye
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 6 hours, 15 minutes
                  1d 6h 15m