Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I setup a search argument on a view. It works, but I cannot sort the view by the search score. I have fixed the problem by adding the following code to the end of the function in modules/search/views_handler_sort_search_score.inc
foreach ($this->view->argument as $handler) {
if (isset($handler->search_score) && $handler->relationship == $this->relationship) {
$this->query->add_orderby(NULL, NULL, $this->options['order'], $handler->search_score);
$this->table_alias = $handler->table_alias;
return;
}
}
Comments
Comment #1
dawehnerCan you please provide a real patch for this change? This would help to get this error fixed.
Comment #2
dawehnerThis would have been so easy if you would have created a patch.
Anyway solved this a bit cleaner.