diff --git a/Controller/ApiController.php b/Controller/ApiController.php index b917e20..812013a 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -209,8 +209,8 @@ final class ApiController extends Controller */ public static function createMediaPath(string $basePath = '/Modules/Media/Files') : string { - $rndPath = \str_pad(\dechex(\mt_rand(0, 65535)), 4, '0', \STR_PAD_LEFT); - return $basePath . '/_' . $rndPath[0] . $rndPath[1] . '/' . $rndPath[2] . $rndPath[3]; + $rndPath = \str_pad(\dechex(\mt_rand(0, 4294967295)), 8, '0', \STR_PAD_LEFT); + return $basePath . '/_' . $rndPath[0] . $rndPath[1] . $rndPath[2] . $rndPath[3] . '/_' . $rndPath[4] . $rndPath[5] . $rndPath[6] . $rndPath[7]; } /** diff --git a/Models/CollectionMapper.php b/Models/CollectionMapper.php index 60bb6ec..3616b07 100755 --- a/Models/CollectionMapper.php +++ b/Models/CollectionMapper.php @@ -99,7 +99,7 @@ final class CollectionMapper extends MediaMapper public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array { $depth = 3; - $query = self::getQuery(); + $query = self::getQuery(depth: $depth); $query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath); $query->where(self::$table . '_d' . $depth . '.media_collection', '=', 1); diff --git a/Models/MediaMapper.php b/Models/MediaMapper.php index 79db48b..0eda17e 100755 --- a/Models/MediaMapper.php +++ b/Models/MediaMapper.php @@ -140,7 +140,7 @@ class MediaMapper extends DataMapperAbstract public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array { $depth = 3; - $query = self::getQuery(); + $query = self::getQuery(depth: $depth); $query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath); if ($hidden === false) { diff --git a/Theme/Backend/media-list.tpl.php b/Theme/Backend/media-list.tpl.php index 6cc55a6..cd7704a 100755 --- a/Theme/Backend/media-list.tpl.php +++ b/Theme/Backend/media-list.tpl.php @@ -164,6 +164,7 @@ $next = empty($media) ? '{/prefix}media/list' : '{/prefix}media/list?{?}&id=