Jump to content

365 Villas Search Engine Code works on 7.1 but not 7.0 - need help getting it to work on 7.0!

Recommended Posts

  • Susana_SQSP changed the title to 365 Villas Search Engine Code works on 7.1 but not 7.0 - need help getting it to work on 7.0!

This is problem I asked you @creedon

@Keniko I asked him (@creedon)  if he can help you with this problem, and here is the answer.

"Although I don't have an explanation of why it works on v7.1, I have found a flaw in the code which causes it to break on v7.0.

A for in loop has been used where a forEach loop should be used.

For in loops are for iterating over an object. forEach for iterating over arrays.

Here is the offending bit of code.

2049716733_ScreenShot2021-04-02at5_10_47PM.png.a1b5a21b6e03d86853131c488c2b940d.png

As we can see the query string is split into an array and then the code tries to walk the array like an object which it is happy to do. So first it reads out the query parameters which are just fine and once it's done with those it moves onto the methods and such of an array and it blows up. Not good!

This an issue for the code developer to fix."

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
9 hours ago, tuanphan said:

This is problem I asked you @creedon

@Keniko I asked him (@creedon)  if he can help you with this problem, and here is the answer.

"Although I don't have an explanation of why it works on v7.1, I have found a flaw in the code which causes it to break on v7.0.

A for in loop has been used where a forEach loop should be used.

For in loops are for iterating over an object. forEach for iterating over arrays.

Here is the offending bit of code.

2049716733_ScreenShot2021-04-02at5_10_47PM.png.a1b5a21b6e03d86853131c488c2b940d.png

As we can see the query string is split into an array and then the code tries to walk the array like an object which it is happy to do. So first it reads out the query parameters which are just fine and once it's done with those it moves onto the methods and such of an array and it blows up. Not good!

This an issue for the code developer to fix."

Thank you!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.