QueryStrings used to trigger page includes are not being properly url encoded in all cases. Spaces are encoded but characters like ampersand (&), percent (%), etc. are not. This leads to unexpected behavior on the “included page” in the parameters that it receives.
The workaround is to use {{#urlEncode}}…{{/urlEncode}} but, at the very least, when using merge syntax on a field value in the querystring passed to the include, the encoding should be handled by Skuid and not require manually applying {{#urlEncode}}…{{/urlEncode}}. Taking this a step farther, regardless of use of merge syntax or not, I think it makes the most sense for Skuid to handle the encoding of the entire querystring. A bare minimum would be anything coming from merge syntax.
Steps to reproduce:
- Create Main page using XML below
- Create Include page using XML below
- Preview Page
- Open developer tools in browser and go to “Network” tab to track calls made
- Click “Open Popup”
Expected Behavior
Account Name should be “default Va&lue”
Actual Behavior
Account Name is “default Va” (because the & was not encoded despite being retrieved using merge syntax)
- Close the popup
- Change the value of “Include Param Value” to “default %”
- Click “Open Popup”
Expected Behavior
Account Name should be “default %”
Actual Behavior
Account Name is “def�lt Value” (because the % was not encoded despite being retrieved using merge syntax)
Sample Main Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true"> <models>
<model id="IncludeDriver" query="true" createrowifnonefound="true" datasource="Ui-Only" processonclient="true" unloadwarningifunsavedchanges="false">
<fields>
<field id="IncludeParamValue" displaytype="TEXT" label="Include Param Value" defaultvaluetype="fieldvalue" defaultValue="default Va&amp;lue"/>
</fields>
<conditions/>
<actions/>
</model>
</models>
<components>
<grid uniqueid="sk-2shrGY-185">
<divisions>
<division behavior="flex" minwidth="100px" ratio="1" verticalalign="top">
<components>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="IncludeDriver" buttonposition="" uniqueid="sk-2shqYg-174" mode="edit">
<columns>
<column width="100%">
<sections>
<section title="Section A" collapsible="no" showheader="false">
<fields>
<field id="IncludeParamValue" valuehalign="" type="">
<renderconditions logictype="and" onhidedatabehavior="keep"/>
<enableconditions/>
</field>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
</division>
<division behavior="flex" verticalalign="top" minwidth="100px" ratio="1">
<components>
<buttonset uniqueid="sk-2sh8R7-85" model="IncludeDriver" position="left">
<buttons>
<button type="multi" label="Open Popup">
<actions>
<action type="showPopup">
<popup title="New Popup" width="90%">
<components>
<includepanel type="skuid" uniqueid="sk-2shQpz-136" pagename="PageIncludeQSParamsNotEncodedInclude" module="" querystring="myparam={{{$Model.IncludeDriver.data.0.IncludeParamValue}}}"/>
</components>
</popup>
</action>
</actions>
</button>
</buttons>
</buttonset>
</components>
</division>
</divisions>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</grid>
</components>
<resources>
<labels/>
<javascript/>
<css/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>
Sample Include Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true"> <models>
<model id="QSTrackerAccountModel" limit="1" query="false" createrowifnonefound="true" datasource="salesforce" type="" sobject="Account" doclone="" unloadwarningifunsavedchanges="false" processonclient="true">
<fields>
<field id="Name"/>
</fields>
<conditions>
<condition type="param" value="myparam" field="Name" operator="=" enclosevalueinquotes="true" novaluebehavior=""/>
</conditions>
<actions/>
</model>
</models>
<components>
<basicfieldeditor showheader="true" showsavecancel="false" showerrorsinline="true" model="QSTrackerAccountModel" buttonposition="" uniqueid="sk-2si_b5-221" mode="read">
<columns>
<column width="100%">
<sections>
<section title="QSTrackerAccountModel" collapsible="no">
<fields>
<field id="Name" valuehalign="" type=""/>
</fields>
</section>
</sections>
</column>
</columns>
</basicfieldeditor>
</components>
<resources>
<labels/>
<javascript/>
<css/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>