I think to keep this change manageable phase zero is the trivial:
- Add site setting
prioritize_solved_topicsdefaulttrue - When set to true, give solved 1.1 unconditionally.
It does not solve all of the quirks here, but it would give us reasonable amount of progress quickly.
Trouble is from an extensibility perspective this is not an easy change at all.
There is no “solved” column on the topics table, what we are stuck doing here is injecting some sort of join from solved into topic custom fields… this mean this SQL needs to be transformed in a rather elaborate way:
Either
-
We need to inject a
LEFT JOINin the solved pluginLEFT JOIN topic_custom_fields ts where name = 'accepted_answer_id' and value IS NOT NULL AND and topic_id = topics.id -
We need to transform this conditions
CASEstatement, which probably means making the whole CASE statement composable using a plugin.
Alternatively we may get away with something like CASE EXISTS(...) THEN 1.1 which eliminates needing a left join but comes with its own risks.
Will have a think about this problem, the huge challenge here is figuring out how not to create a giant mess by adding this support given “core” knows nothing about solved topics.