WordPress.org

Forums

Plugin: Events Manager - Catchable fatal error when clicking on event links (10 posts)

  1. lovemarisol
    Member
    Posted 1 year ago #

    I recently updated Events Manager and now I get this error when you click on an event link. Catchable fatal error: Object of class WP_Error could not be converted to string in /home/moma/public_html/melaniefionaworld.com/wp-content/themes/especial/libraries/breadcrumb.php on line 88

  2. agelonwl
    Member
    Posted 1 year ago #

  3. lovemarisol
    Member
    Posted 1 year ago #

    I've seen that page before and tried what it said and it didn't work. My whole site ended up having an error. But what that page says is to add that code to functions.php. Isn't my problem in breadcrumb.php so something there has to be fixed right?

  4. Marcus
    NetWebLogic Support
    Posted 1 year ago #

    99.9% sure it's to do with your theme, it assumes that every post type has a normal post category (and has at least one set) when that isn't necessarily true (e.g. em events). my snippet just assigns a category automatically before the error occurs, ideally you'd fix your theme.

  5. lovemarisol
    Member
    Posted 1 year ago #

    Huh? I'm confused. What exactly am I supposed to do? I'm fixing my theme how?

  6. agelonwl
    Member
    Posted 1 year ago #

    you can try this one.

    1.)
    Edit your theme breadcrumb.php then find function simple_breadcrumb_case($der_post){

    2.)
    below that add this code global $post;

    3.)
    Find this snippet

    $ID = $category[0]->cat_ID;
    				echo get_category_parents($ID, TRUE, $markup, FALSE );

    And replace with this

    if( $post->post_type == EM_POST_TYPE_EVENT || $post->post_type == EM_POST_TYPE_LOCATION ){
    				$categories = get_the_category();
    				if( count($categories) == 0 ){
    					//assign a category to this
    					wp_set_object_terms($post->ID, 'uncategorized','category');
    				}
    			}else{
    				$ID = $category[0]->cat_ID;
    				echo get_category_parents($ID, TRUE, $markup, FALSE );
    			}
  7. lovemarisol
    Member
    Posted 1 year ago #

    I did that and now my whole site is down and has this error:
    Parse error: syntax error, unexpected '&' in /home/moma/public_html/melaniefionaworld.com/wp-content/themes/especial/libraries/breadcrumb.php on line 80

  8. agelonwl
    Member
    Posted 1 year ago #

    Is it possible to post your breadcrumb.php codes using pastebin?

  9. lovemarisol
    Member
    Posted 1 year ago #

    Ok I put it on pastebin & here's the link: http://pastebin.com/UeDqEjfs

  10. lovemarisol
    Member
    Posted 1 year ago #

    The problem has been fixed. Thank you so much to everyone who tried to help me get it fixed.

Topic Closed

This topic has been closed to new replies.

About this Topic