From ae08723c48995dcb1c2989a4141f7ba0986ef74b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 2 Apr 2024 21:40:48 +0000 Subject: [PATCH] template fixes + bug fixes + style fixes --- Controller/BackendController.php | 8 ++++---- Theme/Backend/profile-list.tpl.php | 4 ++-- tests/Controller/ApiControllerTest.php | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index dd2da8a..0735548 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -75,20 +75,20 @@ public function viewProfileList(RequestAbstract $request, ResponseAbstract $resp $view->data['accounts'] = ProfileMapper::getAll() ->with('account') ->with('image') - ->where('id', $request->getDataInt('id') ?? 0, '<') + ->where('id', $request->getDataInt('offset') ?? 0, '<') ->limit(25)->execute(); } elseif ($request->getData('ptype') === 'n') { $view->data['accounts'] = ProfileMapper::getAll() ->with('account') ->with('image') - ->where('id', $request->getDataInt('id') ?? 0, '>') + ->where('id', $request->getDataInt('offset') ?? 0, '>') ->limit(25)->execute(); } else { $view->data['accounts'] = ProfileMapper::getAll() ->with('account') ->with('image') ->where('id', 0, '>') - ->limit(25)->execute(); + ->limit(25)->executeGetArray(); } /** @var \Model\Setting $profileImage */ @@ -162,7 +162,7 @@ public function viewProfileView(RequestAbstract $request, ResponseAbstract $resp ->with('createdBy') ->where('createdBy', (int) $profile->account->id) ->limit(25) - ->execute(); + ->executeGetArray(); $view->data['media'] = $media; diff --git a/Theme/Backend/profile-list.tpl.php b/Theme/Backend/profile-list.tpl.php index dd78bab..4cae7c5 100755 --- a/Theme/Backend/profile-list.tpl.php +++ b/Theme/Backend/profile-list.tpl.php @@ -20,8 +20,8 @@ */ $accounts = $this->data['accounts'] ?? []; -$previous = empty($accounts) ? '{/base}/profile/list' : '{/base}/profile/list?{?}&id=' . \reset($accounts)->id . '&ptype=p'; -$next = empty($accounts) ? '{/base}/profile/list' : '{/base}/profile/list?{?}&id=' . \end($accounts)->id . '&ptype=n'; +$previous = empty($accounts) ? '{/base}/profile/list' : '{/base}/profile/list?{?}&offset=' . \reset($accounts)->id . '&ptype=p'; +$next = empty($accounts) ? '{/base}/profile/list' : '{/base}/profile/list?{?}&offset=' . \end($accounts)->id . '&ptype=n'; ?>
diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index e98d2d5..1feaa02 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -23,7 +23,6 @@ use phpOMS\Application\ApplicationAbstract; use phpOMS\Dispatcher\Dispatcher; use phpOMS\Event\EventManager; -use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Localization\L11nManager; use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpResponse; @@ -31,7 +30,6 @@ use phpOMS\Module\ModuleAbstract; use phpOMS\Module\ModuleManager; use phpOMS\Router\WebRouter; -use phpOMS\Stdlib\Base\AddressType; use phpOMS\System\MimeType; use phpOMS\Utils\TestUtils;