Keniko Posted April 2, 2021 Share Posted April 2, 2021 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. Link to comment
tuanphan Posted April 5, 2021 Share Posted April 5, 2021 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. 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." Keniko 1 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
creedon Posted April 5, 2021 Share Posted April 5, 2021 @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. Keniko 1 Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support! Link to comment
Keniko Posted April 5, 2021 Author Share Posted April 5, 2021 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! creedon 1 Link to comment
Keniko Posted April 5, 2021 Author Share Posted April 5, 2021 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. 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment