3093 Posts in 875 Topics by 654 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 334 Views |
-
GridFieldDeleteAction not delete in DB

15 July 2012 at 7:34pm
Hi,
I have problem.I have DataObject Aktualnosc
class Aktualnosc extends DataObject {
static $db = array(
'Date' => 'Date',
'Tresc' => 'Text',
);static $belongs_many_many = array(
'HomePage' => 'HomePage'
);public static $has_one = array(
'Photo' => 'Image'
);
public static $summary_fields = array(
'Tresc' => 'Treść',
'Date' => 'Date',
);function getCMSFields() {
$fields = new FieldSet();
$fields->push( $dateField = new DateField('Date', 'Data aktualności'), 'Content' );
$fields->push( new TextField('Tresc', 'Krótka treść' ));
$fields->push( new UploadField( 'Photo', 'Zdjęcie' ) );
$dateField->setConfig('showcalendar', true);
$dateField->setConfig('dateformat', 'dd-MM-YYYY');
return $fields;
}}
and HomePage.php
class HomePage extends Page {
...static $many_many = array(
'Aktualnosci' => 'Aktualnosc',
);public function getCMSFields() {
$fields = parent::getCMSFields();
$gridFieldConfigNews = GridFieldConfig::create()->addComponents(
new GridFieldToolbarHeader(''),
new GridFieldAddNewButton('toolbar-header-right'),
new GridFieldSortableHeader(''),
new GridFieldDataColumns(),
new GridFieldPaginator(50),
new GridFieldEditButton(),
new GridFieldDeleteAction(),
new GridFieldFilterHeader(''),
new GridFieldDetailForm()
);
$gridfieldNews = new GridField('Aktualnosci', 'Aktualności', $this->Aktualnosci(), $gridFieldConfigNews);
$fields->addFieldToTab('Root.Aktualnosci', $gridfieldNews);
return $fields;
}class HomePage_Controller extends Page_Controller {
....
}When I delete post with GridFieldDeleteAction entry in the list delete but in DB is still.
Otherwise in writing.
When I try to delete an entry by clicking on the delete in the list he delete, but in the database is stillCan anyone help
Sorry for my bad English
-
Re: GridFieldDeleteAction not delete in DB

22 August 2012 at 9:12am
Is someone able to help with the solution to this?
I presume it is to do with GridFieldDeleteAction(true) but that just adds in an extra unlink icon, when I just want the delete icon to actually delete the record.
Thanks
-
Re: GridFieldDeleteAction not delete in DB

6 September 2012 at 2:25am
In new SS 3.0.2 RC1 fix it
Change GridFieldDeleteAction in framework/fields/gridfieldcode from here:
https://github.com/silverstripe/sapphire/commit/9a8313d
| 334 Views | ||
|
Page:
1
|
Go to Top |

