• Resolved IoannisX

    (@ioannisx)


    I use All-in-One Event Calendar and when i try to make a collapse menu with “Collapsing Categories” plugin, nothing appears.
    Moreover when , in the settings of “Collapsing Categories” , check “Show empty categories” the following message appears:

    Catchable fatal error: Object of class WP_Error could not be converted to string in /home/ergolhpt/public_html/wp-content/plugins/collapsing-categories/collapscatlist.php on line 61

    AIO Event Calendar version 1.8.3-premium
    Wordpress version 3.4.2
    Theme NewTech

    can you help me please???

    https://www.ads-software.com/extend/plugins/collapsing-categories/

Viewing 4 replies - 1 through 4 (of 4 total)
  • +1 to this, me too.

    i have this error (Catchable fatal error: Object of class WP_Error could not be converted to string in collapscatlist.php on line 61) if i chosen custom taxonomy type and “”links to category archive”. Can you give a hand? Thanks a lot.

    I solved the problem.
    Open collapscatlist.php and move to line 61.

    Old

    $link = "<a href='" . get_term_link($the_cat, $cat->taxonomy) . "' ";

    Change it to:

    $link = "<a href='" . get_term_link(intval($the_cat), $cat->taxonomy) . "' ";

    That is it!

    ========
    P.S.
    I have been very frustrated by people who find solutions to their problems and don’t bother at all to inform others of their solutions. If this problem bothered you for long, please try to post this solution to at least one more place where users can find answers.

    ===========
    There is something too that i found about catchable errors: They are catchable. Therefore a far more robust solution to the problem above is to replace the old code in line 61, i.e:

    Old

    $link = "<a href='" . get_term_link($the_cat, $cat->taxonomy) . "' ";

    with this:

    /*
    Incase of an insolvable link error, use the get_category_link() function which does NOT raise an error upon failure
    */
    if (is_wp_error(get_term_link(intval($the_cat), $cat->taxonomy)))
    	{
    		$link = "<a href='" . get_category_link($the_cat) . "' ";
    	}
    	else
    	{
    		$link = "<a href='" . get_term_link(intval($the_cat), $cat->taxonomy) . "' ";
    	}

    Thread Starter IoannisX

    (@ioannisx)

    awakanto, you are the best!!!
    That solved my problem!
    Thank you very much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Catchable fatal error’ is closed to new replies.