Custom logic on render conditions causes Uncaught Reference Error

When custom logic contains the word “or” or “and” more than once an uncaught reference error is encountered.

Steps to reproduce:

  1. Create page using XML below - Page contains a field with “1 OR 2 OR 3” for rendering custom logic
  2. Preview page

Actual Result
Uncaught Reference error: trueorfalse is not defined

Expected Result
Page displays without error

replace is used for substitution but replace will only replace the first occurrence of the string found. Possibly consider using a regex with global flag (/and/g).

Sample Page

<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="Phone"/>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read">
            <column width="100%">
                  <section title="Basics" collapsible="no">
                        <field id="Name"/>
                        <field id="Phone" valuehalign="" type="">
                           <renderconditions logictype="custom" logic="1 OR 2 OR 3">
                              <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isNew"/>
                              <rendercondition fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isSaved" enclosevalueinquotes="false"/>
                              <rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="rowproperty" sourceproperty="isCloned" value="true"/>

Thanks for reporting this Barry, definitely a bug. We’re working on it.

We have fixed this in dev and it will be released as part of the next patch release.

As always, thanks for the quick resolution!

This was fixed in today’s patch release 5.21.6 of Skuid, which is now available on the Skuid releases page and will be pushed to all orgs on 5.21.x during this weekend.

Initial tests are passing, thanks again guys for the quick turn-around.

Have a great weekend!