Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

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


Keniko

Question

Site URL: https://geckovacations.squarespace.com/

Password: 12345

on the Home Page there is some code for a property search widget. It doesn't show up when the site is live nor in edit mode in Squarespace 7.0 but works fine when I tested it on a 7.1 template. Attached is the error shown. Can anybody please tell me exactly what to do? I am not a coding expert. 

Code Error.jpg

Link to post
  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

Popular Posts

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

@Keniko. To sum up the code is defective and it needs to be brought to the attention of the developer of the code. Please feel free to forward the info I provided to the developer. It should help them

Thank you!

Posted Images

4 answers to this question

Recommended Posts

  • 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."

Link to post
  • 0
34 minutes ago, creedon said:

@Keniko. To sum up the code is defective and it needs to be brought to the attention of the developer of the code. Please feel free to forward the info I provided to the developer. It should help them fix the bug.

Thank you!

Link to post
  • 0
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 post

Create an account or sign in to comment

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


×
×
  • Create New...