Note: I am not sure yet if this is an ECK issue or a Views issue
Problem/Motivation
When creating a view that uses a context filter on the change property (the last time the entity was updated) there is an SQL error and nothing is displayed.
Steps to Reproduce
Create an entity type with the change and create property
Create a view that accepts a url pram as an argument to query against the change or create property
Enter a value into the context filter, if in the preview screen you will see a sql error message, if not no results will be displayed
For MySQL an example of the "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '20160701') ))) subquery' at line 1"
Notice there is no field before the = '' part of the query
Attached to this issue is an export of an Entity and View (using features but repackaged as a zip) that will trigger this error.
Proposed resolution
Add the field to make the SQL statement valid.
It should be noted this works as expected when using the change property from the "FILTER CRITERIA"
| Comment | File | Size | Author |
|---|---|---|---|
| ECK_Error.png | 146.8 KB | cweldon | |
| eck_views_bug.zip | 1.98 KB | cweldon |
Comments
Comment #2
cweldon commentedTaking another look at this it looks like "real_field" is not being set correctly and the formula is also not being set correctly. Using X-Debug I can stop and add these values and the query is built correctly and works as expected. I am not sure where this should be set in the flow of execution
Comment #3
cweldon commentedI think this may be a views issue so I am putting this on hold for now
Comment #4
dieterholvoet commentedWe're dropping support for Drupal 7 since it has officially reached end of life on the 5th of January 2025.