WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] plugin error = Bug in menu of WordPress (34 posts)

  1. pppplus
    Member
    Posted 1 year ago #

    Hi
    There is an error in plugin :
    Erreur : TypeError: this.on is not a function
    Fichier Source : /wp-content/plugins/the-events-calendar/resources/jquery.pjax.js?ver=3.4.2
    Ligne : 5

    This error stops other javascript script.

    Thanks for your help.

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey pppplus. Thanks for the note here; does this occur when you deactivate your other plugins and revert to the 2011 theme? Just wanted to check since we haven't received other reports of this and I haven't been able to recreate myself either...makes me wonder if it's specific to your install.

    Let me know if you have the opportunity to take a look at that and we can try to troubleshoot as needed from there.

  3. ianjohn27
    Member
    Posted 1 year ago #

    Definitely getting this same error on my site. Disable Events calendar and everything is fine again. It appears to be in the pjax.

  4. ianjohn27
    Member
    Posted 1 year ago #

    thanks in advance.

  5. ianjohn27
    Member
    Posted 1 year ago #

    Oh. Actually, it looks like this error might be even more helpful:

    TypeError: $(document).pjax("a.tribe-pjax", {timeout: 10000, fragment: "#tribe-events-content", container: "#tribe-events-content"}) is undefined

    I'm guessing the new default templates have this div in them... my custom ones probably don't.

  6. chrisruggia
    Member
    Posted 1 year ago #

    I'm getting this error as well. In Chrome's Inspector, jquery.pjax.js gives me an error that reads:

    Uncaught TypeError: Object # <Object> has no method 'on'

    and it kills all javascript after that point. Since The Events Calendar's js is in the head, that means all my other plugins don't work.

    I haven't had a chance to see if the error is theme-specific.

  7. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for the notes on this, folks. Since 3 separate people are noting it here it seems likely this is an issue on our end. I've asked the lead dev on the plugin to take a look here and comment directly; if there's a fix we can implement or a workaround we can suggest, we'll of course do so.

    Thanks again for the heads up and your patience so far.

  8. bguthro
    Member
    Posted 1 year ago #

    FYI, I solved this issue by patching jquery.pjax.js

    In the first function, change "this.on" to "this.bind"

    Patch below for reference:

    [ Moderated: Please use pastebin.com and just post the link instead. ]

  9. pppplus
    Member
    Posted 1 year ago #

    yes, perfect !
    No more error.

  10. Barry Hughes
    Member
    Plugin Author

    Posted 1 year ago #

    Sounds like you're all sorted here pppplus - just for information though, there is a known issue where themes or other plugins replace the default copy of jQuery that ships with WordPress with earlier versions.

    There's a detailed summary of this on our own forum - for anyone who is unable to perform the patch suggested by bguthro (looks like that's been removed by a mod in any case) please do take the time to read up on this and contact your theme vendor if necessary.

  11. chrisruggia
    Member
    Posted 1 year ago #

    Thanks, Barry!

    I had replaced WordPress's default jQuery with my own version a while back, and when I updated that, the problem was fixed for me.

  12. Barry Hughes
    Member
    Plugin Author

    Posted 1 year ago #

    Excellent, glad you're sorted here.

  13. ebloss
    Member
    Posted 1 year ago #

    I had the same problem and the above solution worked for me, too. Thanks bguthro!!

  14. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for confirming, everyone! Going to close this out since it seems like we're set here but please let me know if anyone else has problems in the future.

  15. pppplus
    Member
    Posted 1 year ago #

    Same error after a new update !!
    That's not serious !

    Horodatage : 20/01/2013 23:12:15
    Erreur : TypeError: $(...).bind(...).on is not a function
    Fichier Source : http://mywebsite/wp-content/plugins/the-events-calendar/resources/events.js?ver=3.5
    Ligne : 17

    You have to replace all ".on(" by ".bind("
    I don't know if there is problem after in plugin, but now, menu is ok.

    Regards

  16. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for the report on this, pppplus. Going to check with the devs here to see if we introduced something that can be removed for the next build. Appreciate the heads up and apologies for any inconvenience created by this.

  17. bguthro
    Member
    Posted 1 year ago #

    Yes, I had to patch this version, as well to get it to work again.

    All occurrences of "on()" needed to substituted with "bind()"

    4 of them were in
    the-event-calendar/resources/events.js
    1 was in
    the-event-calendar/resources/jquery.pjax.js

    These showed up with obvious red error messages in the Chrome Developer console.
    roblagatta, is Chrome supported?

  18. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Alright bguthro, thanks for the clarification. Got a dev taking a look at this shortly to confirm what's up.

    The plugin is Chrome supported, yes. Had you updated to 2.0.11 to find these problems, or were they still in 2.0.10? There was an issue with the Jquery 1.9 release earlier last week that could have had an impact here, but should be resolved if you updated.

  19. bguthro
    Member
    Posted 1 year ago #

    roblagatta, I honestly couldn't tell you, since I wasn't the one who upgraded the plugin - I just got the call when it broke.

    The last time I fixed it would have been whatever version was available at the time of my original comment, then again a few days ago. The person who upgraded it simply saw in the wp-admin plugins panel, that updates were available, and upgraded.

    Sadly, there is no way to roll back an update.

    I have advised her to not update this plugin unless I have time to debug and fix issues, since 2 updates have shown it to be an unreliable process prone to breaking the rest of her website.

  20. pppplus
    Member
    Posted 1 year ago #

    For me problem comes with the 2 last upgrades.
    My version is 2.0.11

  21. jonahcoyote
    Member
    Posted 1 year ago #

    Hi everybody.

    Where are you guys seeing this error, i.e. what events page? Or, does it happen when you do something like navigate months in the calendar? Can anyone post a link and instructions on how to reproduce? I'm not seeing it at all running the latest 2.0.11 version of our plugin.

    Thanks,
    Jonah

  22. bguthro
    Member
    Posted 1 year ago #

    I can't break the site for the purposes of debugging - but the site in question can be found at http://www.iamers.org

    It is running 2.0.11, and it needed the modifications mentioned above in order to not throw javascript errors, and break other things, like menus, and the front page image.

  23. pppplus
    Member
    Posted 1 year ago #

    Bug is in homepage. Menu has a problem (all is shown, menu and submenu, and impossible to close them).
    And error code in shown in firefox console.

    I use free theme : Black and White (here : http://www.hhcolorlab.com/inspire/websites_for_photographers/black_and_white)

  24. jonahcoyote
    Member
    Posted 1 year ago #

    @bguthro - I don't see any errors related to our plugin. You've got some other javascript errors in place that are unrelated to our plugin. Here's a screenshot of the Chrome console: http://cl.ly/image/0P0j0P252P2e - I would try and sort these out first. Also, you're running a fairly old version of jQuery (1.4.2) so you might try updating that to the most recent WordPress version (1.8.3). That may help.

    @pppplus - you've also got an js error that is unrelated to our plugin. You should clear this up first. Here's a screenshot of the Chrome console: http://cl.ly/image/3S1A233W0Y0r

    - Jonah

  25. pppplus
    Member
    Posted 1 year ago #

    I do not understand your answer.
    Where do you see error on my website ? I don't post my url here.

  26. jonahcoyote
    Member
    Posted 1 year ago #

    @pppplus - sorry, I thought the link you posted above (http://www.hhcolorlab.com/inspire/websites_for_photographers/black_and_white) was your website.

    - Jonah

  27. pppplus
    Member
    Posted 1 year ago #

    no, it is the site where I download the theme.
    So, you can test with this theme, and see there is a problem between theme and your plugin.

  28. bguthro
    Member
    Posted 1 year ago #

    @jonahcoyote - I don't have any errors because, as I mentioned before, I fixed them with the s/on/bind/g fix.

  29. bguthro
    Member
    Posted 1 year ago #

    @jonahcoyote - The version of jQuery I am running is whatever ships stock with WP 3.5 (the latest available.) It seems a bit risky to other functionality to upgrade that.

    Plugins to a platform should conform to the restrictions of that platform, and not require additional non-standard configuration.

    If you require a particular version of jQuery, you should ship this as part of the packaging, or make it clear to the user that you require a minimum version in order to not break other parts of the WP platform.

  30. bguthro
    Member
    Posted 1 year ago #

    hmm... the WP version installed is 1.8.3 - I guess I'll have to look around to try to determine why 1.4.2 is being loaded, if that is what you've determined.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic