FIX Backport and sanitiseClassName for the "Save" action URL

This commit is contained in:
Jake B 2017-09-04 14:59:38 +10:00
parent 58200f847f
commit 04a07d505f

View File

@ -9,9 +9,16 @@ class GridFieldAddNewMultiClassHandler extends GridFieldDetailForm_ItemRequest {
return parent::Link($action);
} else {
return Controller::join_links(
$this->gridField->Link(), 'add-multi-class', get_class($this->record)
$this->gridField->Link(), 'add-multi-class', $this->sanitiseClassName(get_class($this->record))
);
}
}
/**
* Sanitise a model class' name for inclusion in a link
* @return string
*/
protected function sanitiseClassName($class) {
return str_replace('\\', '-', $class);
}
}