Announcement

Collapse
No announcement yet.

Syntax error in object's condition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Syntax error in object's condition

    Hi - I trying to use this expression in v8.05 within a block statement where "category" is a custom property. The line of code works when viewed via a browser, or the actinic page preview, but when checking for coding errors I get the message "Syntax error in object's condition":

    <actinic:variable name="Category" /> == "Dining Sets" AND <actinic:variable name="ProductDescription" /> != ""
    Regards
    David

    #2
    Try putting brackets in:
    Code:
    (<actinic:variable name="Category" /> == "Dining Sets") AND (<actinic:variable name="ProductDescription" /> != "")

    Comment


      #3
      I've just tried this but it gives me the same error message.
      Regards
      David

      Comment


        #4
        David,

        I would suggest calling in to support else creating a support ticket so that someone from the team can take a look a this for you.

        Kind regards,
        Bruce King
        SellerDeck

        Comment


          #5
          My first guess was missing double quotes around the variable. But I have tried it and it doesn't give me any coding error.
          If you contact support and send us a snapshot probably we can find out the reason.
          Zoltan
          Actinic Software
          www.actinic.co.uk

          Comment


            #6
            OK - will do.
            Regards
            David

            Comment


              #7
              I was commenting too much on community recently so your snapshot is landed on my plate (never do it again ).

              The problem is with the ProductDescription variable. It may contain any strings therefore can mess up the condition's syntax. E.g. if the description contains double quotes (or references to other variables) then the substituted value results invalid condition syntax.

              One of the failing condition was
              Code:
              Substituted condition: ("accessories" == "Dining Sets") AND ("
              Large : W 55 x D 36 x H 52 cm
              Medium : W 47 x D 29 x H 44cm
              
              "More Accessories..."" != "")
              You can see the mess created by the quotes around More Accessories. Obviously this error comes up only on the pages where the description contains such a text. All other pages are not reporting the error.

              The solution is to use variable encoding (it is recommended for all text variables). E.g.

              Code:
              (<actinic:variable name="Category" /> == "Dining Sets") AND (<actinic:variable name="ProductDescription"  encoding="strip" /> != "")
              should work without raising any errors.

              I hope it helps.
              Zoltan
              Actinic Software
              www.actinic.co.uk

              Comment


                #8
                I have tried that and it works a treat. Thanks for your help.
                Regards
                David

                Comment

                Working...
                X