-
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
Since 3.0.165 subfield selectors do not work anymore #1400
Comments
@szopos - could you try the latest dev version of PW to see if the issue still exists? |
I upgraded to DEV 3.0.179… same problem. Now the error comes from line 670… |
@szopos I can't seem to duplicate this one. The test I used was like the first one you indicated, though I'm not sure what is in your
The result was a list of matched pages and the titles of their categories (all including the word "database"). |
In fact $q should be a string. The string comes from the search field.
I tried again to add those parts that are causing the error, like:
I also tried to run the search with a hardcoded string: Any ideas? |
@szopos I've translated your new selector to this here for testing:
I also tried this, since just one selector in parenthesis wouldn't be useful:
So far I still cannot duplicate the issue. I'm starting to wonder if it might be coming from one of the Fieldtype modules you have in use that is used by one of these fields: text, text_editor_minimal, text_editor, text_editor2, text_editor3, search_index. Can you tell me what Fieldtypes are used by those fields? Would it be possible for you to edit the /wire/core/PageFinder.php file to enable additional debugging info? If so, on line 664 is this:
Uncomment that line by removing the two |
I uncommented the line 664 and this ist the error message when I am searching for an non existing string like "ggg": "Look out… Fehler: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters - SELECT pages.id,pages.parent_id,pages.templates_id This is what I get when I am searching an existing string like "panasonic": "Ouch… Fehler: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters - SELECT pages.id,pages.parent_id,pages.templates_id I am using the "original" selector:
And these are the field types: text: text_editor_minimal: text_editor, search_index: The other fields are Select Options fileds. template=produkt are children of a PageTable field. |
@szopos Thanks for the additional info. I will go through this in more detail, but had a quick thought I wondered if you could test with your query. If you remove the Options fields from your selector (which I'm thinking is this |
@ryancramerdesign Dangit… Fehler: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters - SELECT pages.id,pages.parent_id,pages.templates_id and this ist the error when I am searching for a not existing string: Oops… Fehler: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters - SELECT pages.id,pages.parent_id,pages.templates_id |
@szopos I still can't duplicate here, so I think we'll need to wait and see if the issue arises for anyone else. So far it seems to be isolated to this report. One thing I notice is that the queries you pasted in are partial queries, like they've been truncated, but I think that's just because it's hitting a max length on the exception message or something. But there are no positional parameters in the partial queries we can see, so the error doesn't match up to anything tangible just yet, but thanks for pasting it in nevertheless. The other thing that might be worth trying is to keep simplifying your selector until the error disappears; then make note of what you removed for the error to disappear, and try using it in a simpler test case to see if it also appears there. That might help narrow in on something specific that would be easier to reproduce. Lastly, it might also be worth updating to the latest dev branch, just in case this is something isolated to the version you are using. |
@szopos, did you try the latest dev version? |
@szopos I'm closing this issue, please comment again to reopen. |
After I updated PW to 3.0.165 I got an Internal Server error when using subfield selectors like $selector = "template=produkt, produkt_hersteller.title%=$q";
The selector shoud work like it worked before version 3.0.165.
Now I ab getting an Internal Server error. In dev mode:
Rats… Fehler: Exception: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (in wire/core/PageFinder.php line 627)
#0 wire/core/Wire.php (400): PageFinder->___find(Object(Selectors), Array)
#1 wire/core/WireHooks.php (823): Wire->_callMethod('___find', Array)
#2 wire/core/Wire.php (465): WireHooks->runHooks(Object(PageFinder), 'find', Array)
#3 wire/core/PagesLoader.php (350): Wire->__call('find', Array)
#4 wire/core/Pages.php (255): PagesLoader->find('template=produk...', Array)
#5 wire/core/Wire.php (397): Pages->___find('template=produk...')
#6 /home/httpd/v
My initial selector was
$selector = "template=produkt, check2|check_temp=1, (title|text|text_editor_minimal|text_editor|text_editor2|text_editor3|search_index~=$q), (produkt_hersteller.title%=$q), (produkt_bereiche.title%=$q), (produkt_anwendungen.title%=$q), (produkt_verwendungen.title%=$q), (produkt_geratetypen.title%=$q), (produkt_gruppen.title%=$q), (produkt_verdichter.title%=$q), (produkt_kaltemittel.title%=$q), (produkt_gwp.title%=$q)";
Now I ended with this one (I avoided subselectors):
$selector = "template=produkt, check2|check_temp=1, (title|text|text_editor_minimal|text_editor|text_editor2|text_editor3|search_index%=$q)";
ProcessWire version: 3.0.165
The text was updated successfully, but these errors were encountered: