Skip to content
Snippets Groups Projects

Issue #3135440 by J-Lee, Steven Jones: Allow more than 1 alias per page.

+ 3
3
@@ -77,9 +77,9 @@ function language_hierarchy_query_path_alias_language_fallback_alter(AlterableIn
// Replace the existing language code ordering.
$fields = &$query->getOrderBy();
unset($fields['base_table.langcode']);
$fields = [$alias . '.priority' => 'DESC'] + $fields;
// Limit the query as only the first result will be used anyway.
$query->range(0, 1);
// Sort by the priority, being careful to match the order of the id field on
// the base table so that results appear in the order that core is expecting.
$fields = [$alias . '.priority' => $fields['base_table.id']] + $fields;
}
/**
Loading