mirror of
https://github.com/flarum/core.git
synced 2025-08-20 07:11:31 +02:00
Fix ordering bug
If an empty request is sent to the /tags/order endpoint, all tags would get moved to secondary tags.
This commit is contained in:
@@ -30,6 +30,10 @@ class OrderTagsController implements ControllerInterface
|
||||
|
||||
$order = array_get($request->getParsedBody(), 'order');
|
||||
|
||||
if ($order === null) {
|
||||
return new EmptyResponse(422);
|
||||
}
|
||||
|
||||
Tag::query()->update([
|
||||
'position' => null,
|
||||
'parent_id' => null
|
||||
|
Reference in New Issue
Block a user