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
Tracked queries are not triggered when updating fields that are not in the query conditions #527
Comments
Thanks for the explanation, but changing the entry status should trigger a cache refresh since both |
Indeed, A dump at the end of RefreshCacheHelper::getElementTypeQueryRecords
The only records in my table
prevents any results. |
In my tests, |
While writing this explanation I worked out that there is a setting for the Preparse fields But this was my test case before: the Entrytype has a field of type Preparse Field
To avoid interference with other attributes, I just print this on a page:
When I disable one of the jobs entries, there isn't even a RefreshCacheJob, so nothing I can trace there. When I enable the job again, there is a RefreshCacheJob with this data:
At this point the isChangedByAttributes is true. So there will be no tracked queries matched. |
Thanks, I'll look into what might be going on with the Preparse field. |
I’m still unable to figure out what the issue is. In thinking through this, however, if your Preparse field contains an element query, then only the result of executing that query is stored in the database, not the query itself. Does that make sense? |
Hi Ben, Sorry for the late reply. I set up a test case without the Preparse field. Please try this: ddev start
ddev exec php craft install
ddev exec php craft migrate/all
|
Thanks, that was very helpful! I managed to narrow this down to tracked element queries ignoring disabled elements when determining which cached pages to refresh. Fixed in 95289cb with an accompanying feature test, and released in version 4.5.2. |
@bencroker thanks a lot! |
1. Steps to reproduce the issue.
helpers\RefreshCacheHelper::getElementTypeQueryRecords()
will add a join withelementQueryFields
andelementQueryAttributes
as soon($isChangedByAttributes || $isChangedByFields)
is trueelementQueryFields
andelementQueryAttributes
are only filled with attributes or fields used in the query to filter and order by.The plugin and Craft version numbers.
Craft 4.4.15 with Blitz 4.4.6
The text was updated successfully, but these errors were encountered: