bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Javascript error in topic-js.php whenever I go to a topic page

(18 posts)
  • Started 6 months ago by JohnConners
  • Latest reply from chrishajer
  • This topic is not resolved
  1. Having done a completely new install of bbPress 0.9.0.1 (to make sure there wasn't a problem with my existing templates / plugins), when I log in and browse to any topic page I get a javascript error on the following line in bb-includes/js/topic-js.php:

    favoritesToggle[ 1 === isFav ? 'removeClass' : 'addClass' ]( 'is-not-favorite' );

    Apparently favoritesToggle[....] is not a function, according to Firefox.

    Apart from that, great work!

    Posted 6 months ago #
  2. I get the same error as reported in firebug:

    favoritesToggle[1 === isFav ? "removeClass" : "addClass"] is not a function
    <urlhere>/bb-includes/js/topic-js.php?ver=20080401
    Line 55

    Posted 6 months ago #
  3. Broken JavaScript is a non-trivial, since it will trigger a very visible error message for some users... on essentially every topic page, when logged in. The error isn't FireFox-specific.

    Commenting out the contents of the "addLoadEvent( function() { // TopicMeta" block of code in topic-js.php appears to remove the error without creating new issues: The underlying AJAX behaviour is broken anyway. A proper fix would be appreciated.

    Edit: Ok... playing with *this* forum, it seems there is already a fix: The equivalent code in http://bbpress.org/forums/bb-includes/js/topic-js.php?ver=433 appears to work just fine.

    Posted 6 months ago #
  4. Please ticket this in Trac...

    http://trac.bbpress.org/

    Posted 6 months ago #
  5. I fixed the error by adding

    <?php bb_enqueue_script('jquery'); ?>

    just before

    <?php bb_enqueue_script('topic'); ?>

    in header.php in the theme

    Posted 6 months ago #
  6. Thanks so1o, that's the quick an dirty fix. That code uses jQuery methods, and jQuery is not available in topic pages.

    It didn't get picked up because that code falls back to non-ajax requests when it fails.

    We are half way through removing all prototype in favour of jQuery, and this snuck under the radar.

    Posted 6 months ago #
  7. i thought so..

    Posted 6 months ago #
  8. I am still getting this error on my install despite having implemented the above fix.

    Any idea when it will be resolved in the main branch of BB?

    Posted 6 months ago #
  9. fokjulle
    Member

    I'm also still getting this problem...

    Posted 5 months ago #
  10. Here is the trac ticket:
    http://trac.bbpress.org/ticket/851

    Looks like it's fixed in the trunk release, but I haven't seen a date for a new release yet.

    Posted 5 months ago #
  11. fokjulle
    Member

    Is this the same problem that I'm experiencing? I'm not a techie, so I don't really understand what's being said here. In short, when logged in, my topic threads' CSS gets broken a bit. When I'm not logged in, it works fine.

    Is this the same problem?

    Posted 5 months ago #
  12. fokjulle
    Member

    Is there anything I can do to rectify this? I don't understand what "trunk" means.

    Posted 5 months ago #
  13. Trunk means the error has been fixed in the code repository but it hasn't been packaged into a new release yet.

    You can get the latest trunk code here:
    http://trac.bbpress.org/changeset/1428/branches/0.9?old_path=%2F&format=zip

    I have no idea if there are any problems with that release though. You only need one tiny fix for this problem.

    Also, it seems like you have a lot of interesting things going on with your installation based on the number of threads posted here. I suspect there is more going on than just a couple tiny, unrelated problems. If you can afford to do it without losing any work, you might want to try a fresh installation and start from scratch.

    Posted 5 months ago #
  14. fokjulle
    Member

    Well, I only installed the BBPress about 2 days ago...

    Posted 5 months ago #
  15. fokjulle
    Member

    I've overwritten all my current files on the server, with the ones in that trunk code, and still nothing is fixed. My forum is here. Please have a look and tell me what is going on...

    Posted 5 months ago #
  16. Is it possible things are cached in your browser? I logged into your forum and I don't see any JavaScript errors once logged in (or even before that.)

    It seems like this problem is fixed?

    Posted 5 months ago #
  17. fokjulle
    Member

    I've cleared the cache and nothing changed.

    Here are screenshots of what I'm talking about.

    The correct one (when I'm logged out):
    http://i80.photobucket.com/albums/j166/fokjulle/Untitled-1-14.gif

    The incorrect way (when I'm logged in):
    http://i80.photobucket.com/albums/j166/fokjulle/Untitled-2-3.gif

    Posted 5 months ago #
  18. I could not log in with IE6 or IE7. Not sure why.

    With FF 2.0.0.13, I see the difference. Seems like a template problem, stuff is just in the wrong place. I think the theme author mentioned in another thread that a new release was coming. I suspect this will be fixed in that release.

    Posted 5 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.