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!
  • Replies 4
  • Views 557
  • Created
  • Last Reply

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

@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.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
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 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

Archived

This topic is now archived and is closed to further replies.

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