Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-8452

Core UI Plural Translation Value Object returns incorrect messages for singular and plural forms

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 5.0.x-dev, 4.6.8
    • 3.3.37, 4.6.7
    • OSS
    • None
    • Ibexa Open Source

    Description

      Note: while it affects 3.3, we're heading slowly towards EOM, so fixing on 4.6.
       

      \Ibexa\Contracts\Core\Repository\Values\Translation\Plural::__toString implementation returns plural message string for singular value and singular message string for plural value respectively.

      Background: \Ibexa\Contracts\Core\Repository\Values\Translation\Plural implementation used by \Ibexa\Contracts\Core\FieldType\ValidationError was supposed to analyse given value and return singular form message, like "John has 1 apple" when value is 1 and plural when value is not 1, e.g. "John has 2 apples".

      Steps to reproduce

      1. Install clean version of Ibexa DXP, any Edition
      2. Place the attached here sample-1.1MB.jpg file in the project root.
      3. Import & execute migration of the two attached migration files:
        I. ibx_8458_01_content_type.yaml
        II. ibx_8458_02_content.yaml

      Actual behavior

      Observe the following error:

      In ContentFieldValidationException.php line 59:
                                                   
        Content "Test" fields did not validate:    
        - The file size cannot exceed 1 megabytes.  
      

      Expected behavior

      The error should state:

      In ContentFieldValidationException.php line 59:
                                                   
        Content "Test" fields did not validate:    
        - The file size cannot exceed 1 megabyte.  
      

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              andrew.longosz@ibexa.co Andrew Longosz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: