WordPress.org

Support

Support » Plugins and Hacks » WP VeriteCo Timeline » A fix for PHP 5.4 warnings empty value

A fix for PHP 5.4 warnings empty value

  • When saving a Timeline entry I got multiple: Warning: Creating default object from empty value in… etcetera, on a blank page. This was with a new install (v. 1.1.1) on a server new to me. After googling on the issue I managed to fix it in wp-veriteco-timeline.php. Find:

    if ($thumbnail_image && isset($thumbnail_image)) {
    	$this->asset->media = $img[0];
    	$this->asset->caption = $thumbnail_image->post_excerpt;
    }

    Replace this with:

    if ($thumbnail_image && isset($thumbnail_image)) {
    	if (!is_object($this->asset)) {
    		$this->asset = new stdClass;
    	}
    	$this->asset->media = $img[0];
    	$this->asset->caption = $thumbnail_image->post_excerpt;
    }

    I suppose you have to do the same with the next lines for video. And maybe more, but I have to find that out yet.

    https://wordpress.org/plugins/wp-veriteco-timeline/

Viewing 1 replies (of 1 total)
  • Thanks for working this out. I just posted on this error, too. I didn’t get from your title that we were having the same problem. Anyway, I applied your fix and it worked. No muss, no fuss.

Viewing 1 replies (of 1 total)
  • The topic ‘A fix for PHP 5.4 warnings empty value’ is closed to new replies.
Skip to toolbar