Forums

Collapsing Categories
Javascript syntax error - causing expanding not to work + fix (1 post)

  1. vitalvital
    Member
    Posted 4 months ago #

    Sometimes there is an extra comma (depending on the widget settings) that is not addressed in the code and it is causing javascript error that prevents the widget from functioning - no expanding/collapsing.

    The bad comma is present in the call to this function:
    addExpandCollapse('widget-collapscat-4-top','<img src="/wp-content/plugins/collapsing-categories/img/expand.gif" alt="expand" />', '<img src="/wp-content/plugins/collapsing-categories/img/collapse.gif" alt="collapse" />'<strong style="color: red;">, )

    To fix it (actually just to apply a workaround):
    in .../collapsing-categories/collapscat.php on lines 143-144
    replace this

    echo "addExpandCollapse('widget-collapscat-$number-top'," .
              "'$expandSym', '$collapseSym', " . $accordion . ")";

    With this

    $addExCol = "addExpandCollapse('widget-collapscat-$number-top'," .
              "'$expandSym', '$collapseSym', " . $accordion . ")";
          echo str_replace ( "', )" , "' )" , $addExCol );

    This workaround simply removes the "bad" comma.

    http://wordpress.org/extend/plugins/collapsing-categories/

Reply

You must log in to post.

About this Plugin

About this Topic