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

Array to String error when filtering by reference type and navigating to next page #100

Closed
planeth44 opened this issue Aug 30, 2018 · 4 comments
Milestone

Comments

@planeth44
Copy link

Let's say I have a table produit and one field in the table is a reference to another table client.

On the productList page, I filter by the client_id field.
The result gives me 2 pages.
If I navigate to the page 2, the error occurs.

This the DBALException message:

An exception occurred while executing 'SELECT COUNT(id) FROM `produit` `produit` WHERE (`id_client` = ?) AND (deleted_at IS NULL)' with params [{"id":<UUID>"}]:

Notice: Array to string conversion

The URL of the page:
crud/produit?crudPage=1&crudSortField=created_at&crudSortAscending=true&crudFilterid_client%5Bid%5D=<UUID>

@philiplb
Copy link
Owner

Ou, good find. Thx for the report!

@planeth44
Copy link
Author

I came up with a temporary fix in the list template

            {% if crudData.getDefinition().getType(filterField) == 'reference' and filterValue.id is defined %}
                {% set filterValue = filterValue.id %}
            {% endif %}

@philiplb philiplb added this to the 0.14.0 milestone Sep 6, 2018
@philiplb
Copy link
Owner

philiplb commented Sep 6, 2018

This has been fixed via 8a1a6eb .
Looking forward to the release of 0.14.0 tomorrow or monday. :)

@philiplb philiplb closed this as completed Sep 6, 2018
@planeth44
Copy link
Author

Splendid!

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

No branches or pull requests

2 participants