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
Move Featured Entries to the Top is breaking the Search (again) #1308
Comments
This has probably been fixed in https://github.com/gravityview/Featured-Entries/pull/27 Please confirm and close. |
@rafaehlers Can you please test? |
@rafaehlers @jlgrisham Please test. |
Sorry, I forgot to mention this was tested and fixed already. |
It seems "Move Featured Entries to the Top" is still breaking the search. If "Move Featured Entries to Top" is checked on the settings of a View, you can't combine an Advanced Filter condition and a Search Bar filter. You can have them separately, but not combined. Steps to reproduce:
You'll get an SQL error about an unknown column. In fact, the problem is that it tries to access the column using an unset alias. Here's an example:
GV 2.7.1 and FE 2.0.5 |
This actually works fine. Having an Any/Everything restriction has the correct SQL generated. In the example error the Advanced Filter was set to field ID 2. So the correct way to reproduce it is to set explicit fields for either the Search Bar or the AF (or both). It also works if you have two different field AF conditions, as the second missing join is actually generated (m3). So looks like the Search bar is not generating its own join as needed. But this only happens when Move To Top is selected, the join actually gets merged: What we do in Because the Search condition has a remnant forced alias! Doh. The solution would be to either strip the aliases from the conditions that we're copying over, or keep the original query intact and tack the featured order clause onto it instead of doing this substitution. The latter is not possible though, as the So alias-stripping then, eh? This is something we did discuss with Steven in our latest meeting back in February - how it's difficult to change the where and order clauses without copying them over to a new |
Fixed by creating a stripping utility method and utilizing it inside the Featured Entries plugin. Please test and let me know. This may need some unit tests. Cheers. |
@soulseekah not working here: https://secure.helpscout.net/conversation/1221497152/27985/ |
@soulseekah f5e79fa and https://github.com/gravityview/Featured-Entries/commit/9e9b5e62f8e584b8aefd9d45a021a788ff7b6f6a break the search when a filter condition contains a multi-input field. ... |
Fixed by https://github.com/gravityview/Featured-Entries/releases/tag/v2.0.7 Time to close this sucker :) 🎆 |
When this option was checked (Move Featured Entries to the Top), the search results are incorrect.
GV 2.3.1 and FE 2.0.3
The text was updated successfully, but these errors were encountered: