forcedotcom / lwc-dev-server-feedback

LWC Local Development
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

getPicklistValuesByRecordType wire adapter returns HTML/XML escaped data #43

Open honzaluksch opened 4 years ago

honzaluksch commented 4 years ago

Describe the bug When using getPicklistValuesByRecordType wire adapter to fetch picklist values from org, it seems to return HTML/XML escaped data. It results to incorrect behaviour if you have ampersands or other special character in picklist values.

E.g. Picklist value "Tom & Jerry" comes as "Tom & Jerry"

To Reproduce Steps to reproduce the behavior:

  1. Have a picklist fields with picklist values containing special characters, such as ampersand, quotation mark...
  2. Use getPicklistValuesByRecordType wire adapter in you lightning web component code to retrieve picklist values from the picklist.
  3. Run LWC dev server and display the component.
  4. Debug data retrieved in browser console or display the via lightning-combobox (or other element).
  5. Deploy the same component to the org and debug the same code.
  6. See the error - compare the data retrieved by the component on localhost and the org. Local component gets the picklist value XML escaped while component on org gets values in correct shape (unescaped).

Expected behavior getPicklistValuesByRecordType wire adapter should have consistent behaviour on both LWC dev server and Salesforce org.

Screenshots Picklist field setup: image

Picklist values displayed on LWC Dev Server: image

Picklist values displayed on org: image

Raw data on LWC Dev Server: image

Desktop:

Additional context LWC Dev Sever connects to dev sandbox (API version 47). It is the same sandbox I was deploying the test component to.

Other wire adapters or UI API related libraries may be affected.

crysislinux commented 4 years ago

It's actually the same case for getRecord, getRecordUi and most likely all those wire apis. There should be a parameter to disable the escaping.

stale[bot] commented 4 years ago

This issue has been automatically marked as type:bug-p3 because it has not had recent activity.

git2gus[bot] commented 4 years ago

This issue has been linked to a new work item: W-7305378