WPP-Public/akqa-nz-silverstripe-versioneddataobjects

namespace error in version 2.0

Closed this issue · 2 comments

Hi,

When clicking on the new 'Versioning ...' button in the CMS, the following error is thrown:

Class 'Heyday\VersionedDataObjects\DataList' not found in /usr/local/www/silverstripe/docroot/silverstripe-versioneddataobjects/code/VersionedDataObjectDetailsForm.php

The error occurs on line 251 of VersionedDataObjectDetailsForm.php and cause appears to be that DataList is not namespaced, ie, code should be:

$this->record = \DataList::create($this->record->class)->byID($this->record->ID);

instead of

$this->record = DataList::create($this->record->class)->byID($this->record->ID);

thanks!
Steve

Hi, thanks for pointing that out.

The "Versioning..." button you refer to is provided by Uncle Cheese's Better Buttons module and the error happens when using that button as well as the "Cancel draft changes" button provided by Heyday's Versioned Data Objects module.

We have made a new release (2.0.2) with a fix for this. Instead of using the slash, we included the use of the DataList class at the top of the VersionedDataObjectDetailsForm class, for consistency, as shown below.

use DataList;

Thanks again.

thanks Jeremy!
Steve