protected function publishSection() {
		$parent = DataObject::get_by_id('NewsHolder', $this->ParentID);
		while ($parent && $parent instanceof NewsHolder) {
			if (!$parent->isPublished()) {
				$parent->doPublish();
			}
			$parent = $parent->Parent();
		}
	}
protected function publishSection() {
		$parent = DataObject::get_by_id('NewsHolder', $this->ParentID);
		while ($parent && $parent instanceof NewsHolder) {
			if (!$parent->isPublished()) {
				$parent->doPublish();
			}
			$parent = $parent->Parent();
		}
	}
protected function publishSection ( ) { $ parent = DataObject :: get_by_id ( 'NewsHolder' , $ this -> ParentID ) ; while ( $ parent && $ parent instanceof NewsHolder ) { if ( ! $ parent -> isPublished ( ) ) { $ parent -> doPublish ( ) ; } $ parent = $ parent -> Parent ( ) ; } }
Ensure's the section is published.

We need to do it both before and after publish because of some quirks with
folders not existing on one but existing on the other depending on the order of
writing the objects
Ensure s the section is published .