Release 2.0.33 (#4273)

* added function to check if meta-field is defined by a plugin
* hide un-defined meta-fields in details view
* fix default charset = utf8mb4
* remove broken DATABASE_VERSION fallback
* split off upgrade infos for version 1.x
* fix page out of range #4279
This commit is contained in:
Kevin Papst
2023-09-07 22:24:08 +02:00
committed by GitHub
parent 31348da4c0
commit 6e1207578e
27 changed files with 495 additions and 424 deletions

View File

@@ -9,13 +9,23 @@
namespace App\Utils;
use App\Repository\Query\BaseQuery;
use Pagerfanta\Adapter\AdapterInterface;
use Pagerfanta\Pagerfanta;
final class Pagination extends Pagerfanta
{
public function __construct(AdapterInterface $adapter)
public function __construct(AdapterInterface $adapter, ?BaseQuery $query = null)
{
parent::__construct($adapter);
if ($query !== null) {
$this->setMaxPerPage($query->getPageSize());
$this->setCurrentPage($query->getPage());
}
if ($query === null || !$query->isApiCall()) {
$this->setNormalizeOutOfRangePages(true);
}
}
}