mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Add onAfterSave extension point to GridFieldDetailForm_ItemRequest
This commit is contained in:
parent
a50fd009ca
commit
9170220d2c
@ -44,7 +44,6 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
|
|||||||
protected $component;
|
protected $component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var DataObject
|
* @var DataObject
|
||||||
*/
|
*/
|
||||||
protected $record;
|
protected $record;
|
||||||
@ -161,7 +160,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
|
|||||||
* complete controller with gaps for extra functionality. This, for example, would be a better way
|
* complete controller with gaps for extra functionality. This, for example, would be a better way
|
||||||
* of letting Security/login put its log-in form inside a UI specified elsewhere.
|
* of letting Security/login put its log-in form inside a UI specified elsewhere.
|
||||||
*
|
*
|
||||||
* @return Form
|
* @return Form|HTTPResponse
|
||||||
*/
|
*/
|
||||||
public function ItemEditForm()
|
public function ItemEditForm()
|
||||||
{
|
{
|
||||||
@ -468,6 +467,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
|
|||||||
// Save form and any extra saved data into this dataobject
|
// Save form and any extra saved data into this dataobject
|
||||||
$form->saveInto($this->record);
|
$form->saveInto($this->record);
|
||||||
$this->record->write();
|
$this->record->write();
|
||||||
|
$this->extend('onAfterSave', $this->record);
|
||||||
|
|
||||||
$extraData = $this->getExtraSavedData($this->record, $list);
|
$extraData = $this->getExtraSavedData($this->record, $list);
|
||||||
$list->add($this->record, $extraData);
|
$list->add($this->record, $extraData);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user