Skip to content

Commit

Permalink
[AdminListBundle] Change pagerfanta dependencies to require the minim…
Browse files Browse the repository at this point in the history
…um needed packages
  • Loading branch information
acrobat committed Mar 15, 2021
1 parent b4fda4c commit 4aba6ab
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 9 deletions.
10 changes: 10 additions & 0 deletions UPGRADE-5.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UPGRADE FROM 5.7 to 5.8
=======================

General
-------

If you still require the `kunstmaan/bundles-cms` package, update you `composer.json` to require `babdev/pagerfanta-bundle`
instead of `white-october/pagerfanta-bundle`. All specific bundle packages that use pagerfanta functionality are now requiring
the specifc pagerfanta packages. Newer skeleton installs will require the correct pagerfanta bundle package but old projects
or projects using the `white-october` package are encouraged to switch their dependencies.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"friendsofsymfony/user-bundle": "^2.0",
"knplabs/knp-menu-bundle": "^3.0",
"guzzlehttp/guzzle": "~6.1",
"white-october/pagerfanta-bundle": "~1.0",
"babdev/pagerfanta-bundle": "^2.5",
"kunstmaan/google-api-custom": "~1.0",
"gedmo/doctrine-extensions": "^2.4.34",
"doctrine/doctrine-fixtures-bundle": "^3.3",
Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/AdminBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
"require": {
"php": "^7.2",
"babdev/pagerfanta-bundle": "^2.5",
"doctrine/orm": "^2.5",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
Expand Down Expand Up @@ -52,8 +53,7 @@
"symfony/yaml": "^3.4|^4.4",
"twig/twig": "^1.40|^2.9",
"twig/extensions": "~1.0",
"sensio/framework-extra-bundle": "^5.0",
"white-october/pagerfanta-bundle": "~1.0"
"sensio/framework-extra-bundle": "^5.0"
},
"suggest": {
"kunstmaan/translator-bundle": "^5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Kunstmaan\AdminListBundle\AdminList\Filter;
use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM\AbstractORMFilterType;
use Kunstmaan\AdminListBundle\AdminList\SortableInterface;
use Pagerfanta\Adapter\DoctrineORMAdapter;
use Pagerfanta\Doctrine\ORM\QueryAdapter as OrmQueryAdapter;
use Pagerfanta\Pagerfanta;
use Traversable;

Expand Down Expand Up @@ -92,7 +92,7 @@ public function getDeleteUrlFor($item)
public function getPagerfanta()
{
if (\is_null($this->pagerfanta)) {
$adapter = new DoctrineORMAdapter($this->getQuery());
$adapter = new OrmQueryAdapter($this->getQuery());
$this->pagerfanta = new Pagerfanta($adapter);
$this->pagerfanta->setNormalizeOutOfRangePages(true);
$this->pagerfanta->setMaxPerPage($this->getLimit());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

class DoctrineDBALAdapterTest extends TestCase
{
/**
* Mark test as legacy to avoid "\Pagerfanta\Exception\Exception" interface deprecation
*
* @group legacy
*/
public function testConstructorWithIncorrectCountField()
{
$this->expectExceptionMessage('The $countField must contain a table alias in the string.');
Expand Down
5 changes: 4 additions & 1 deletion src/Kunstmaan/AdminListBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
],
"require": {
"php": "^7.2",
"box/spout": "^2.5",
"kunstmaan/admin-bundle": "^5.7",
"box/spout": "^2.5"
"pagerfanta/core": "^2.4",
"pagerfanta/doctrine-orm-adapter": "^2.4",
"pagerfanta/twig": "^2.4"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.0",
Expand Down
4 changes: 3 additions & 1 deletion src/Kunstmaan/ArticleBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"require": {
"php": "^7.2",
"kunstmaan/adminlist-bundle": "^5.2",
"kunstmaan/pagepart-bundle": "^5.2"
"kunstmaan/pagepart-bundle": "^5.2",
"pagerfanta/core": "^2.4",
"pagerfanta/twig": "^2.4"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.0",
Expand Down
3 changes: 2 additions & 1 deletion src/Kunstmaan/MediaBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"symfony/mime": "^4.4",
"imagine/imagine": "~0.6",
"knplabs/knp-gaufrette-bundle": "~0.1",
"kunstmaan/adminlist-bundle": "~5.2"
"kunstmaan/adminlist-bundle": "~5.2",
"pagerfanta/twig": "^2.4"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.0",
Expand Down
4 changes: 3 additions & 1 deletion src/Kunstmaan/NodeSearchBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"php": "^7.2",
"kunstmaan/admin-bundle": "^5.7",
"kunstmaan/pagepart-bundle": "~5.2",
"kunstmaan/search-bundle": "~5.2"
"kunstmaan/search-bundle": "~5.2",
"pagerfanta/core": "^2.4",
"pagerfanta/twig": "^2.4"
},
"require-dev": {
"matthiasnoback/symfony-config-test": "^4.0",
Expand Down

0 comments on commit 4aba6ab

Please sign in to comment.