Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Missing author in LatestPagesWidget


Go to End


1490 Views

Avatar
Henk Poley

30 Posts

30 December 2009 at 2:27am

My latest pages widget doesn't display the author anymore (the hover text now ends in 'By ').

The code of the widget is:

	function LatestPages() {
		$pages = DataObject::get('SiteTree', '', '`LastEdited` DESC', '', 5);
		$return = new DataObjectSet();
		foreach($pages as $page) {
			$versioned = Versioned::get_version("SiteTree", $page->ID, $page->Version);
			//var_dump($versioned);
			$author = Member::get_one("Member", "ID = " . (int)$versioned->AuthorID);
			//var_dump($author);
			$return->push(new ArrayData(array('Page' => $versioned, 'Author' => $author)));
		}
		return $return;
	}

var_dump($versioned); returns all items with AuthorID = 0. So I suspect something is broken there.

Anybody knows a fix so the author is again mentioned in the tooltip?