QueryString not properly encoded when opening page include

  • 1
  • Problem
  • Updated 2 years ago
  • Acknowledged
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:
1) Create Main page using XML below
2) Create Include page using XML below
3) Preview Page
4) Open developer tools in browser and go to "Network" tab to track calls made
5) 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)

6) Close the popup
7) Change the value of "Include Param Value"  to "default %"
8) 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>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
I have been able to reproduce the issue and have logged a ticket for our development team. I cannot thank you enough for providing the XML for reproduction pages. Gold Star.

I'll update this community post when the fix is released.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Yup. Barry is the best at doing the Steps, Expected and Actual thing. Never once seen him submit a suspected bug any other way.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thank you both! :)