[Bb-trac] [bbPress] #851: JavaScript Error: favoritesToggle[1 === isFav ? "removeClass" : "addClass"] is not a function

bbPress bb-trac at lists.bbpress.org
Tue Apr 8 19:57:53 GMT 2008


#851: JavaScript Error: favoritesToggle[1 === isFav ? "removeClass" : "addClass"]
is not a function
-----------------------+----------------------------------------------------
 Reporter:  timskii    |       Owner:                                                 
     Type:  defect     |      Status:  new                                            
 Priority:  normal     |   Milestone:                                                 
Component:  Front-end  |     Version:                                                 
 Severity:  normal     |    Keywords:  Javascript, Ajax, favoritesToggle, topic-js.php
-----------------------+----------------------------------------------------
 When logged in, examining a topic, this error occurs on page load:

 favoritesToggle[1 === isFav ? "removeClass" : "addClass"] is not a
 function - in bb-includes/js/topic-js.php

 Use Firefox+Firebug to analyse the error. Internet Explorer 7 also fails,
 so likely the error is not browser-specific.

 The first erroneous line is:

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

 Error prevents all Ajax code related to the favourites from functioning.
 BBPress defaults to reloading the entire page, so favourites can still be
 set. However some users will experience an (annoying) error message from
 their browser. Developers that like working with clean code will get a
 headache.

 Current trunk code already differs from 0.9.1 here, so this *may* already
 be fixed for a future release.

 http://bbpress.org/forums/topic/javascript-error-in-topic-jsphp-whenever-i
 -go-to-a-topic-page

-- 
Ticket URL: <http://trac.bbpress.org/ticket/851>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list