Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Developer Tools error with .functions.php mod
This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 3 months ago.
- AuthorPosts
- June 5, 2017 at 6:48 am #13357
Hi Ernest,
I believe you were on Holiday, hope you had a great time with your family.
Sorry to bust on into your “smooth transition” this morning π but I am having an issue with the code that you provided for my functions file.I noticed that my popups stopped working and checked my Chrome Developer Tools and found the following error:
Uncaught TypeError: Cannot read property ‘join’ of null
at addCommas ((index):4198)
at HTMLInputElement.<anonymous> ((index):4212)
at Function.each (jquery.js?ver=1.12.4:2)
at a.fn.init.each (jquery.js?ver=1.12.4:2)
at HTMLDocument.<anonymous> ((index):4211)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)
jquery.ajaxsearchpro.min.js:3 ASP initialized via window.loadI can’t remember if this happened before or after the recent update but I do know that if I remove the code from my functions, the error goes away…
If you need a copy of the code in my functions file, let me know but I think you still have it noted somewhere.
Let me know,
Have a great day further.Thank you,
BruceJune 5, 2017 at 8:35 am #13362Hi Bruce!
You are not bothering at all π
I think I know where the problem is – I forgot to add an check for empty values in one of the code part, which converts the number to the formatted number, so it breaks on empty values.
I’ve made a tiny modification to the final code, this should account for empty inputs as well, and treat them as 0 value:
I hope this gets rid of the error messages π
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 5, 2017 at 11:25 am #13367Thanks Ernest,
Ok, two part answer to the solution. Yes, π It did work, thank you, thank you, thank you!
But, I had to revert back to the default configuration – it puts a zero in the custom field, so a user cannot just start typing as the result is for example: 0,200,000 instead of 200,000.Also, the zero cannot be deleted.
I think it’s just something small that can be sorted out – π
Let me know.
Thank You,
Kind Regards.Bruce Griggs
June 5, 2017 at 1:41 pm #13369Hi Bruce,
Indeed, that is not correct.
Let’s try this one:
Let me know if you find something unusual π
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 5, 2017 at 2:26 pm #13371Hi Ernest,
It’s working like a dream, thank you π
I did notice though that I get the following error which it hasn’t done before but the ASP doesn’t get loaded here and also the problem seems to be related to Google rather, so I am finding a solution – I doubt it’s on your end but if it looks familiar, please let me know, other than that THANK YOU SO MUCH :), I really appreciate it! …Here’s that codeMixed Content: The page at ‘https://www.propertynow.co.za/for-sale/’ was loaded over HTTPS, but requested an insecure image ‘http://www.google.com/intl/en_us/mapfiles/close.gif’. This content should also be served over HTTPS.
Have a great day further.
Thank you,
Kind Regards.
BruceJune 6, 2017 at 12:33 pm #13376You are very welcome π
The error refers to an image that was loaded via ‘http’ protocol, but the rest of the page is loaded via ssl secure connection. That image is definitely not related to the search, it’s probably some other plugin with a google map feature or something, it’s probably only a very small issue you will be able to fix.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 6, 2017 at 12:37 pm #13379Thanks for your response Ernest π
Definitely I have traced the issue to a plugin, so I am finding time this afternoon to sit with it to sort it out.Your code was key π yesterday…perfection, thanks for that!
Have a great day further.
Thank you,
Kind Regards.Bruce
June 6, 2017 at 12:39 pm #13381You are very welcome π
I will keep this topic open for a while, in case something comes up.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 7, 2017 at 1:16 pm #13405Hi Ernest,
I managed to sort out the other error which was easy to fix… yesterday after sorting out the issue, I noticed another error which I overlooked because my website always has this error:
“Failed to load resource: the server responded with a status of 400 ()”The above error doesn’t bother me and has been there for a while, because everything works fine and it has been there since the beginning but goes away with different browsers, so again not a problem…but this following error pops up with ASP Activated and goes away when Deactivated… it did start with the new code you gave me on Monday (sorry, good code, so I suspect another issue)… problem is, it is still interfering with my site because my maps aren’t showing… when I take the code out, all is back to normal..
My Real Estate Plugin Developer won’t help because the issue started with another plugin…
Please help, here’s the error:
The first error shows that it comes from the /wp-admin/admin-ajax.php
Error 1:Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Error 2: Uncaught SyntaxError: Unexpected token )
at Object.error (property-search-map.min.js:1)
at i (jquery.js:2)
at Object.fireWith [as rejectWith] (jquery.js:2)
at y (jquery.js:4)
at XMLHttpRequest.c (jquery.js:4)June 7, 2017 at 1:56 pm #13410Hi Bruce!
Can I check on the problem somewhere directly (with FTP and back-end access)? (or maybe re-create it on the test server)
The error codes are reffering to an ajax request, which is likely started by the maps plugin, but somehow is unsuccessful.I would like to test how the ASP plugin affects this request, and try to debug though the code to see where it may come from. It does not look like a direct conflict, I’m guessing there is perhaps a class name or a function name re-declared or something that may cause this other maps ajax request to fail.
The error log only tells that the request was sent from the maps search script, but eventually failed with an error, but no other reference to any other script, so it might be much more complicated to detect.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 7, 2017 at 3:33 pm #13420You cannot access this content.June 7, 2017 at 4:32 pm #13428One think I forgot, can you link me to the page where the errors (missing maps, admin-ajax.php errors) appear?
Best,
Thanks!
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 7, 2017 at 4:34 pm #13430You cannot access this content.June 7, 2017 at 4:36 pm #13431It’s https to the previous response but it will redirect so you can just click the links.
Thanks
June 7, 2017 at 11:05 pm #13440Hi!
Thanks!
I was able to solve this finally. I had to add some new code to the plugin to bypass that ajax request. I have honestly no clue what was causing it exactly. Whenever the main search class was loaded, the error immediately appeared. However that search class file was not even in use, so it does not make sense at all. I feel like that class may have been used within another plugin, but it’s nearly impossible to find out.
Eventually I give up on finding the cause, I simply added an exception to not run the plug-in whever the ajax request is done by the Essential Real estate plugin. That seems to have solved the map loading issue.
I will make sure to include this exception with the upcoming release, so you won’t have to worry about it anymore.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.