7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Sortable Data Object Not Working?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1106 Views |
-
Sortable Data Object Not Working?

12 May 2009 at 2:36pm Last edited: 12 May 2009 2:56pm
I am trying to make my dataobject called Models sortable. When I add the following code to my _config.php file:
SortableDataObject::add_sortable_class('Model');
Then I do a /dev/build/, I am taken to an admin login where I put in the username and password, but it never lets me login. Any idea what could be wrong?
-
Re: Sortable Data Object Not Working?

12 May 2009 at 4:28pm Last edited: 12 May 2009 4:57pm
I am now getting an error message that there is a problem with the output at Line 1 of Model.php. I've pasted my code below, if anyone can see what's wrong.
<?php
class Model extends DataObject {
static $db = array (
'ModelName' => 'Text',
'ModelLink' => 'Text'
);
static $has_one = array (
'BrandPage' => 'BrandPage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('ModelName'),
new TextField('ModelLink')
);
}
function Second(){
return $this->iteratorPos % 2;
}
}
?> -
Re: Sortable Data Object Not Working?

13 May 2009 at 1:52am
This is just a guess, but I'll bet Model is a reserved classname.
| 1106 Views | ||
|
Page:
1
|
Go to Top |
