-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
SQL document queries don't work on older existing tenants #16580
Comments
A workaround, or possible solution, is to set the YesSql ID column type from appsettings for these tenants. |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Does that affect an already deployed DB? I thought it only helps with creating new tables in the future. (also note that the SQL Query source uses Dapper directly, not via YesSql) |
Describe the bug
The
query
Liquid filter (andSqlQuerySource
in general) doesn't work with content item queries in certain databases. Only older/legacy databases are affected, for example I was able to reproduce this problem in two DotNest tenants (using the OC 2.0 branch of DotNest) that iirc were created in 2021 and 2022 respectively. Newer tenants are not affected. The problem is that in these databases the document ID column isint
instead ofbigint
, which is the case for newer tenants:This was fine in 1.8, but became a problem after #16234 where the assumption that the document ID column must be
long
is hard coded.Orchard Core version
Using the latest
main
branch at the time of writing,To Reproduce
Steps to reproduce the behavior:
int
document IDs. Below for convenience I will also assume the site has BlogPost content items, like when running the Blog recipe.BlogPosts
select DocumentId from ContentItemIndex where Published = true and Latest = true and ContentType = 'BlogPost'
Expected behavior
The query should return expected results. Note that the same query actually returns results if you uncheck the "Return Documents" box.
Logs and screenshots
If applicable, add log files, browser console logs, and screenshots (or screen recording videos) to help explain your problem.
The text was updated successfully, but these errors were encountered: