Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #474 from sonata-project/fix_reorder
Browse files Browse the repository at this point in the history
Fix reorder
  • Loading branch information
ElectricMaxxx committed Jul 31, 2017
2 parents 4c26f1e + 0bf441e commit ff6f36e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Controller/TreeController.php
Expand Up @@ -102,6 +102,10 @@ public function reorderAction(Request $request)
return new JsonResponse(array('Parameters parent, dropped and target has to be set to reorder.'), Response::HTTP_BAD_REQUEST);
}

if (in_array($position, array('over', 'child'))) {
return new JsonResponse(array('Can not reorder when dropping into a collection.'), Response::HTTP_BAD_REQUEST);
}

$before = 'before' == $position;
$parentNode = $this->session->getNode($parentPath);
$targetName = PathHelper::getNodeName($targetPath);
Expand Down

0 comments on commit ff6f36e

Please sign in to comment.