Merge pull request #302 from lpostiglione/patch-1

Fix support for dot notation in GridFieldOrderableRows
This commit is contained in:
Marcus 2021-05-13 10:09:52 +10:00 committed by GitHub
commit 719c0ed547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,7 +396,12 @@ class GridFieldOrderableRows extends RequestHandler implements
}
// Get records from the `GridFieldEditableColumns` column
$data = $request->postVar($grid->getName());
$gridFieldName = $grid->getName();
if (strpos($gridFieldName, '.') !== false) {
$gridFieldName = str_replace('.', '_', $gridFieldName);
}
$data = $request->postVar($gridFieldName);
$sortedIDs = $this->getSortedIDs($data);
if (!$this->executeReorder($grid, $sortedIDs)) {
$this->httpError(400);