Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

  • @johnconners

    Participant

    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!

Viewing 17 replies - 1 through 17 (of 17 total)
  • @nuprn1

    Member

    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

    @timskii

    Member

    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 https://bbpress.org/forums/bb-includes/js/topic-js.php?ver=433 appears to work just fine.

    @sambauers

    Participant

    Please ticket this in Trac…

    https://trac.bbpress.org/

    @so1o

    Participant

    I fixed the error by adding

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

    just before

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

    in header.php in the theme

    @sambauers

    Participant

    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.

    @so1o

    Participant

    i thought so..

    @suleiman

    Member

    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?

    @fokjulle

    Member

    I’m also still getting this problem…

    @chrishajer

    Participant

    Here is the trac ticket:

    https://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.

    @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?

    @fokjulle

    Member

    Is there anything I can do to rectify this? I don’t understand what “trunk” means.

    @chrishajer

    Participant

    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:

    https://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.

    @fokjulle

    Member

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

    @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…

    @chrishajer

    Participant

    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?

    @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

    @chrishajer

    Participant

    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.

Viewing 17 replies - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.
Skip to toolbar