Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have this error whn trying to use knp_paginator_sortable: Compile Error: Declaration of Knp\Component\Pager\Event\Subscriber\Sortable\Doctrine\ORM\Query\OrderByWalker::walkSelectStatement(Doctrine\ORM\Query\AST\SelectStatement $AST): string must be compatible with Doctrine\ORM\Query\TreeWalkerAdapter::walkSelectStatement(Doctrine\ORM\Query\AST\SelectStatement $selectStatement): void #796

Open
SGuirous opened this issue Jul 16, 2024 · 12 comments

Comments

@SGuirous
Copy link

Bug Report

Q A
BC Break yes/no
Bundle version x.y.z
Symfony version x.y.z
PHP version x.y.z

Summary

Current behavior

How to reproduce

Expected behavior

@SGuirous
Copy link
Author

Could you please help me fix this issue!! i am using Symfony 5.4 php 8.1 . Thank you!

@SGuirous
Copy link
Author

i am using this code in the twig: <th {% if cities.isSorted('f.cityCode') %} class="sorted" {% endif %}>{{ knp_pagination_sortable(cities, 'Ville'|trans, 'f.cityCode')|raw }}

@garak
Copy link
Collaborator

garak commented Jul 26, 2024

Doctrine version?

@SGuirous
Copy link
Author

doctrine/orm 3.2.1

@SGuirous
Copy link
Author

doctrine/cache 2.2.0
doctrine/collections 2.2.2
doctrine/dbal 3.8.6
doctrine/deprecations 1.1.3
doctrine/doctrine-bundle 2.12.0
doctrine/doctrine-migrations-bundle 3.3.1
doctrine/event-manager 1.2.0
doctrine/inflector 2.0.10
doctrine/instantiator 2.0.0
doctrine/lexer 3.0.1
doctrine/migrations 3.8.0
doctrine/orm 3.2.1
doctrine/persistence 3.3.3
doctrine/sql-formatter 1.4.0
egulias/email-validator 4.0.2
knplabs/knp-components v3.6.0
knplabs/knp-paginator-bundle v5.9.0

Thanks!

@garak
Copy link
Collaborator

garak commented Jul 26, 2024

Try using knplabs/knp-paginator-bundle 6

@SGuirous
Copy link
Author

I've developped the part that does the sorting using Javascript and it works fine. But this does not solve the issue . How do you "Try using knplabs/knp-paginator-bundle 6" ?

@garak
Copy link
Collaborator

garak commented Jul 30, 2024

@SGuirous you have that dependency in your composer.json, right? Edit the version constraint.

@SGuirous
Copy link
Author

"require": {
"php": ">=7.2.5",
"ext-ctype": "",
"ext-iconv": "
",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.2",
"knplabs/knp-paginator-bundle": "^6.0",
"league/csv": "^9.16",
"phpdocumentor/reflection-docblock": "^5.4",
"phpstan/phpdoc-parser": "^1.29",
"symfony/apache-pack": "^1.0",
"symfony/asset": "5.4.*",

then composer update -W and this is the error i get: Your requirements could not be resolved to an installable set of packages.

Problem 1
- knplabs/knp-paginator-bundle[v6.0.0, ..., v6.2.0] require symfony/config ^6.0 -> found symfony/config[v6.0.0, ..., v6.4.8] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.3.0 requires symfony/config ^6.3 || ^7.0 -> found symfony/config[v6.3.0, ..., v6.4.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.4.0 requires symfony/cire symfony/config ^6.0 -> found symfony/config[v6.0.0, ..., v6.4.8] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.3.0 requires symfony/config ^6.3 || ^7.0 -> found symfony/config[v6.3.0, ..., v6.4.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.4.0 requires symfony/c v6.4.8] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.3.0 requires symfony/config ^6.3 || ^7.0 -> found symfony/config[v6.3.0, ..., v6.4.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.4.0 requires symfony/c - knplabs/knp-paginator-bundle v6.3.0 requires symfony/config ^6.3 || ^7.0 -> found symfony/config[v6.3.0, ..., v6.4.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.4.0 requires symfony/c.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- knplabs/knp-paginator-bundle v6.4.0 requires symfony/config ^6.4 || ^7.0 -> found symfony/config[v6.4.0, ..., v6.4.8, v7.0.0, ..., v7.1.1] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires knplabs/knp-paginator-bundle ^6.0 -> satisfiable by knplabs/knp-paginator-bundle[v6.0.0, ..., v6.4.0]. My best educated guess is that this does not work with Symfony 5.4...

@garak
Copy link
Collaborator

garak commented Jul 30, 2024

So either you upgrade to Symfony 6 or you downgrade to Doctrine 2

@SGuirous
Copy link
Author

As i said i have developped a JS alternative and i am happy with it.

@garak
Copy link
Collaborator

garak commented Jul 31, 2024

"but this doesn't solve the issue". Your words.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants