Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-107508

Form Data provider cannot read from JSON file with encoding UTF--8 with BOM

    Details

      Description

      *Steps to reproduce: *

      On 7.2 and above it is needed to allow access to local network:

      Control Panel -> Configuration -> System Settings -> Data provider -> check "Access Local Network"

      1. Open the attached list.json with some text editor which enables you to save it with specific encoding (I used Notepad++). Save the file with "UTF-8 with BOM" encoding. (The file already should use that encoding, but just to be sure)
      2. Add the list.json file to Documents and Media.
      3. From the document details, get its URL.
      4. In Content/Forms, add a new data provider with the URL obtained in step 3 (Displayed JSON Attribute = color and Stored JSON Attribute = value and Type= List)
      5. Create a new form where you place a "Select from list" field using the data provider created in step 4.
      6. Place a Form portlet on some portal page and select the Form created in step 5.

      Result: the dropdown field is not populated and in the browser's Network and Console tab you will see that the data provider URL is giving HTTP-400 response.
      (URL is something like /o/dynamic-data-mapping-data-provider/?ddmDataProviderInstanceId=XXXXXX)

      Also note that if the json file is saved with just UTF-8 encoding without BOM, everything works.

        Attachments

        1. list.json
          0.3 kB
        2. Q.gif
          Q.gif
          6.08 MB
        3. screenshot-1.png
          screenshot-1.png
          36 kB
        4. screenshot-2.png
          screenshot-2.png
          33 kB
        5. screenshot-3.png
          screenshot-3.png
          38 kB

          Activity

            People

            Assignee:
            harry.chai Harry Chai
            Reporter:
            lino.alves Lino Alves
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 32 weeks, 5 days ago

                Packages

                Version Package
                7.0.10.14 DXP SP14
                7.0.X
                7.1.10 DXP FP18
                7.1.10.5 SP5
                7.1.X
                7.2.X
                7.3.1 CE GA2
                7.3.2 CE GA3
                7.3.10 DXP GA1
                Master