-
Notifications
You must be signed in to change notification settings - Fork 2
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
findJoin fails for page reference fields #1951
Comments
@ryancramerdesign - I also wonder if we could have the join options made available for |
Sorry, I am getting sidetracked here, but I am starting to wonder about the benefits of autojoining PR fields. It seems like initially all that is loaded is an array of page IDs references by the Here some experiments I think that are interesting. Note the execution time for each of these and that the It's definitely worth thinking through what's happening in each of these, but the one comparison that really stands out to me is the difference between #1 and #4 which seems to show that the autojoin really isn't as useful as I would expect if you actually need to do anything with the PR field. It's still much quicker than #3, but if the |
Also seeing an error with text fields when checking value of the field in selector. "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_limited_to.data' in 'field list' on line: 168 in /Users/adrianjones/Sites/griefcoach.test/wire/core/WireDatabasePDOStatement.php" It works fine if the autojoin checkbox is checked - it only fails with trying to join within the find() query. And it only happens if I do something like these where I am filtering to the field being empty or not empty.
If I just do |
@ryancramerdesign - I think some of what I am seeing here is related to these things I posted about back in 2022: It's such a great feature being able to join on a query by query basis, but at the moment there are just too many problems still. |
@adrianbj I can't duplicate the issue here. Here's what I'm testing with, maybe I'm missing some part? The field "brands" is a Page Reference field. The results have a mixture of pages with 0 to 2 pages populated for the brands field.
Also tried this:
|
Hi @ryancramerdesign - sorry you can't reproduce that error - neither can I right now so it must be related to some exact selector situation, not just page reference fields in general. However, I am still seeing lots of other issues with this findJoin approach. The first is the text field when checking if empty or not empty as noted above: #1951 (comment) - this should be very easy to reproduce (I just checked again). The other current problem I am seeing is where adding a page reference field to the list of fields to autojoin will prevent another also specified field from being loaded, eg:
returns: but:
returns: There are two problems with this - the In both examples, the Please let me know if you need any more details cause it would be really great to get these all sorted. Thanks! |
Short description of the issue
If you try to include a page reference field in a
findJoin()
(or with thefind()
and thefield=page_reference_field
approach you get this error: "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line: 168 in /Users/adrianjones/Sites/griefcoach.test/wire/core/WireDatabasePDOStatement.php"Expected behavior
No error - should work as it does if the page reference field is permanently autojoined via the field settings checkbox.
Actual behavior
Fails with that error. I thought perhaps I might need something like
page_reference_field.id
but this doesn't work either. In the case of single PR fields, it prevents the error, but the field still isn't joined, but in the case of multi-value PR fields, the error persists.The text was updated successfully, but these errors were encountered: