Please add this check to stop php notices

#10527
  • Resolved Dale Woods
    Rank Math free

    Hi guys

    I am getting this annoying notice filling up my logs about a breadcrumb property not being set.

    I fixed this issue by just adding an isset check in your getter method in rank-math.php line 97

    else if( isset( $this->{$prop} )) {

    public function __get( $prop ) {
    	if ( array_key_exists( $prop, $this->container ) ) {
    		return $this->container[ $prop ];
    	}
    
    	else if( isset( $this->{$prop} )) {
    		return $this->{$prop};
    	}
    	
    	return false;
    }

    Without the added isset check, I keep getting this message on pages without breadcrumbs on them, like my shopping cart page.

    Notice: Undefined property: RankMath::$breadcrumbs in D:\xampp_php7\htdocs\thepodking\wp-content\plugins\seo-by-rank-math\rank-math.php on line 103

    I use the schema theme also.

    If you could, please add this in 🙂

    • This topic was modified 4 years, 9 months ago by Dale Woods.
Viewing 1 replies (of 1 total)
  • Hi Dale,

    Thank you for the suggestion and for bringing this to our attention!

    I have alerted our dev team about this and we will be getting back to you in a short while.

    We appreciate your patience. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Please add this check to stop php notices’ is closed to new replies.