mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX: Missing returns, and checks if records were passed
This commit is contained in:
parent
8f129423cf
commit
a3e55785ac
@ -25,26 +25,32 @@ class VersionedGridFieldBulkManager_Request extends GridFieldBulkManager_Request
|
||||
|
||||
public function publish(SS_HTTPRequest $request) {
|
||||
$recordList = $this->getPOSTRecordList($request);
|
||||
$records = $this->gridField->List->byIDs($recordList);
|
||||
|
||||
foreach($records as $record) {
|
||||
if(!$this->doPublish($record))
|
||||
unset($recordList[$record->ID]);
|
||||
if($recordList && count($recordList)) {
|
||||
$records = $this->gridField->List->byIDs($recordList);
|
||||
|
||||
foreach($records as $record) {
|
||||
if(!$this->doPublish($record))
|
||||
unset($recordList[$record->ID]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->completeAction($recordList);
|
||||
return $this->completeAction($recordList);
|
||||
}
|
||||
|
||||
public function unpublish(SS_HTTPRequest $request) {
|
||||
$recordList = $this->getPOSTRecordList($request);
|
||||
$records = $this->gridField->List->byIDs($recordList);
|
||||
|
||||
foreach($records as $record) {
|
||||
if(!$this->doUnpublish($record))
|
||||
unset($recordList[$record->ID]);
|
||||
if($recordList && count($recordList)) {
|
||||
$records = $this->gridField->List->byIDs($recordList);
|
||||
|
||||
foreach($records as $record) {
|
||||
if(!$this->doUnpublish($record))
|
||||
unset($recordList[$record->ID]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->completeAction($recordList);
|
||||
return $this->completeAction($recordList);
|
||||
}
|
||||
|
||||
protected function doPublish($record) {
|
||||
|
Loading…
Reference in New Issue
Block a user