3060 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 432 Views |
-
SS3 Versioned Data in Model Admin

21 June 2012 at 3:16am
I'm trying to manage a Versioned DataObject in ModelAdmin as soon as I make the Object versioned I get the following error in the Model Admin
[Warning] array_flip() expects parameter 1 to be array, null givenAny Ideas?
-
Re: SS3 Versioned Data in Model Admin

24 July 2012 at 5:44pm Last edited: 24 July 2012 5:46pm
Same issue here. I narrowed it down to the fact that my DataObject didn't have a has_one relationship (the offending line is looking for has_one IDs):
[Warning] array_flip() expects parameter 1 to be array, null given
GET /admin/tests/Test/EditForm/field/Test/item/2/editLine 1374 in C:\wamp\www\framework\model\DataObject.php
To avoid the bug, the class being extended by Versioned must have a has_one relationship to either itself or another DataObject.
This code works:
class Test extends DataObject {
static $has_one = array(
'Image' => 'Image'
);
static $extensions = array(
'Versioned'
);}
Whereas this code doesn't:
class Test extends DataObject {
static $extensions = array(
'Versioned'
);}
Same results when using the usual Object::add_extension method.
Could anyone shed some light on why a has_one relationship is necessary?
-
Re: SS3 Versioned Data in Model Admin

15 November 2012 at 11:09pm
Not sure if you are still having this issue, but take a look at
https://github.com/icecaster/silverstripe-versioned-gridfieldCheers!
| 432 Views | ||
|
Page:
1
|
Go to Top |


