Developer Tools error with .functions.php mod

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 Ernest Marcinko 6 years, 10 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #13357
    Bruce Griggs
    Bruce Griggs
    Participant

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

    I 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,
    Bruce

    #13362
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #13367
    Bruce Griggs
    Bruce Griggs
    Participant

    Thanks 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

    #13369
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #13371
    Bruce Griggs
    Bruce Griggs
    Participant

    Hi 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 code

    Mixed 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.
    Bruce

    #13376
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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 :)


    #13379
    Bruce Griggs
    Bruce Griggs
    Participant

    Thanks 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

    #13381
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You 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 :)


    #13405
    Bruce Griggs
    Bruce Griggs
    Participant

    Hi 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)

    #13410
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #13420
    Bruce Griggs
    Bruce Griggs
    Participant
    You cannot access this content.
    #13428
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    One think I forgot, can you link me to the page where the errors (missing maps, admin-ajax.php errors) appear?
    Thanks!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13430
    Bruce Griggs
    Bruce Griggs
    Participant
    You cannot access this content.
    #13431
    Bruce Griggs
    Bruce Griggs
    Participant

    It’s https to the previous response but it will redirect so you can just click the links.

    Thanks

    #13440
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.