Fixing undefined variable $dataList

This commit is contained in:
Sean Harvey 2013-02-12 15:19:25 +13:00
parent b41da2d7c1
commit c40488a423
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,8 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
* @return Array Map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
*/
public function getHTMLFragments($gridField) {
$dataList = $gridField->getList();
if(class_exists('UnsavedRelationList') && $dataList instanceof UnsavedRelationList) {
return array();
}
@ -246,6 +248,8 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP
* @param Array $data Data submitted in the request
*/
protected function saveGridRowSort(GridField $gridField, $data) {
$dataList = $gridField->getList();
if(class_exists('UnsavedRelationList') && $dataList instanceof UnsavedRelationList) {
user_error('Cannot sort an UnsavedRelationList', E_USER_ERROR);
return;