mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-29 01:06:38 +01:00
Pass media order when calling task:listmedia
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed Undefined property: stdClass::$image in 1.8.2 [#1454](https://github.com/getgrav/grav-plugin-admin/issues/1454)
|
||||
* Now passing media order when calling for the list of media
|
||||
* Pass media order when calling `task:listmedia`
|
||||
|
||||
# v1.8.2
|
||||
## 05/24/2018
|
||||
|
||||
@@ -1576,6 +1576,8 @@ class AdminController extends AdminBaseController
|
||||
{
|
||||
$this->uri = $this->uri ?: $this->grav['uri'];
|
||||
$uri = $this->uri->post('uri');
|
||||
$order = $this->uri->post('order');
|
||||
|
||||
if ($uri) {
|
||||
/** @var UniformResourceLocator $locator */
|
||||
$locator = $this->grav['locator'];
|
||||
@@ -1586,8 +1588,11 @@ class AdminController extends AdminBaseController
|
||||
|
||||
$media_path = $page ? $page->path() : null;
|
||||
}
|
||||
if ($order) {
|
||||
$order = array_map('trim', explode(',', $order));
|
||||
}
|
||||
|
||||
return $media_path ? new Media($media_path) : null;
|
||||
return $media_path ? new Media($media_path, $order) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user