Url param condition on Model set to load client side incorrectly applied resulting in no data (Banzai 7.12)

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
  • (Edited)
When a model contains a condition based on a URL parameter and the Model is marked to "Process Model client-side", if the parameter is not in the URL, the generated SOQL contains the condition with the value set to the name of the url parameter.  This results in no data or unexpected data being returned.

Steps to Reproduce:
1) Create standard account detail page
2) Mark Account model to "Process Model client-side"
3) Add condition on field "Name" where value is equal to Page/URL parameter value "acctname" setting value to deactivate this condition if not specified.
4) Preview page providing Id and acctname value
5) Check SOQL for model - Expected = Actual = ""SELECT Name,CreatedDate,Id FROM Account WHERE (Id = '00137000003of14AAA')AND(Name = 'myname') LIMIT 2"
6) Remove acctname from url and refresh page

Expected
SOQL should be "SELECT Name,CreatedDate,Id FROM Account WHERE (Id = '00137000003of14AAA') LIMIT 2"

Actual
SOQL is "SELECT Name,CreatedDate,Id FROM Account WHERE (Id = '00137000003of14AAA')AND(Name = 'acctname') LIMIT 2"

Note
1) If the model is NOT marked to process client side, this problem does not occur.
2) In prior versions of Skuid, if the condition was set to "Specified Value" and the condition was marked as "Filterable Default Off" and the condition had a name, if the URL contained a parameter name that matched the condition, it would be applied.  In Banzai 7.12, when model is NOT marked to process client side, this same behavior is encountered.  However, when model is marked to "process client-side", the url parameter is not applied as a condition.  I'll create a separate issue for this but since it might be related, I mention it here as well. Update: Issue posted at https://community.skuidify.com/skuid/topics/model-condition-not-applied-on-client-side-model-when-a-...

Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account" adapter="" type="" doclone="" processonclient="true">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
         </fields>
         <conditions>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
            <condition type="param" value="acctname" field="Name" operator="=" enclosevalueinquotes="true" novaluebehavior="deactivate" state="" inactive="false"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-3YqCCB-67">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="delete"/>
            <action type="clone"/>
            <action type="share"/>
            <action type="savecancel" window="self"/>
         </actions>
      </pagetitle>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-3YqCCB-68">
         <columns>
            <column width="100%">
               <sections>
                  <section title="Basics">
                     <fields>
                        <field id="Name"/>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Andrew Duensing

Andrew Duensing, Employee

  • 740 Points 500 badge 2x thumb
This has been resolved, will be fixed with the next patch. Thanks for letting us know Barry.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Thank you Andrew!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Tested and confirmed as resolved in Skuid 7.16.  Thank you!