-
-
Notifications
You must be signed in to change notification settings - Fork 827
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
dev/core#748 Switch alphabetQuery to use new getSearchSQLParts() function #13772
dev/core#748 Switch alphabetQuery to use new getSearchSQLParts() function #13772
Conversation
(Standard links)
|
This looks good! The craziness of this legacy code is starting to dissapate I'll pull it down & give it a spin once jenkins has passed judgement |
Just noting the alphabet query does have test coverage |
Jenkins re test this please |
@mattwire I went through & did the same refactor as you & here is a patch of mine against yours
The important parts are
Also note we can probably simplify the prepareOrderBy & general web further is we agree this can be merged #13748 - that $additionalFromClause is a pain from a code POV but I think it actually BREAKS stuff from a usability pov |
@eileenmcnaughton With the GROUP BY change we don't need to call |
@mattwire ah yeah - you are right re FGB - so we should remove the reenable as well I think. I do think the other part I suggested - the deprecation rather than remove from parent could be needed for custom searches |
3d5198a
to
dbcf34c
Compare
@eileenmcnaughton I think I've addressed your comments. If tests pass this is ready for review again |
dbcf34c
to
ae644bc
Compare
@eileenmcnaughton Ok I've addressed your comments - I think this is now ok to merge? |
ae644bc
to
fa38b06
Compare
@mattwire those deprecated lines are hit... :-( |
It's catch 22. Leave the Could we just put a deprecated warning into getSearchSQL() and return a NULL query? The worst thing I think it's going to break is that you'll only have the standard letters across the top of the results instead of all "extra" letters. Which is not likely to affect English and most European names which start with a standard letter even if they then use accents etc. later on. And provide an upgrader message to the effect that you should check your custom searches if relying on this feature. |
* @param null $sortOrder | ||
* Who knows? Hu knows. He who knows Hu knows who. | ||
* @param string $additionalFromClause | ||
* Should be clause with proper joins, effective to reduce where clause load. | ||
* @return array | ||
* list(string $orderByClause, string $additionalFromClause). | ||
*/ | ||
protected function prepareOrderBy($sort, $sortByChar, $sortOrder, $additionalFromClause) { | ||
protected function prepareOrderBy($sort, $sortOrder, $additionalFromClause) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additionalFromClause is no longer required in this signature - I haven't removed to keep this from going stale but we should do as a follow up
fa38b06
to
caefed7
Compare
unrelated fail |
Overview
This replaces #13733 following merge of #13735. Partial based on #13713
Before
getSearchSQL is only called from one place in with $sortByChar set to TRUE and each part of the query building functions have special handling for this parameter. We disable full group by for this query as it's not supported.
After
Some of the specific handling for $sortByChar query is pulled out of the generic functions, simplifying them. We generate the specific lines of query in the one place they are actually used. We also generate a GROUP BY clause that is compatible with fullgroupby.
Technical Details
$sortByChar is used only for a single, very specific query to generate the list of characters which should be displayed as dynamic filters at the top of search results. The code which builds the search queries is over-complex and this helps simplify it.
Comments
@eileenmcnaughton Replacement for #13733 based on your work in #13735