Skip to content
Snippets Groups Projects
Commit 092acf1d authored by Al Munnings's avatar Al Munnings
Browse files

Merge branch '3447229-sortkey-by-term' into '2.2.x'

Issue #3447229: SortKey by term weight for taxonomies - Apply supplied patch

See merge request !81
parents e52c3630 5e69c0f0
No related branches found
No related tags found
No related merge requests found
Pipeline #177879 passed
......@@ -243,6 +243,9 @@ class EntityConnectionQueryHelper implements ConnectionQueryHelperInterface {
case 'PROMOTED':
return 'promote';
case 'WEIGHT':
return 'weight';
default:
return $this->getEntityType()->getKey('id');
}
......@@ -277,6 +280,9 @@ class EntityConnectionQueryHelper implements ConnectionQueryHelperInterface {
case 'PROMOTED':
return isset($entity->promote) ? (int) $entity->get('promote')->value : 0;
case 'WEIGHT':
return isset($entity->weight) ? (int) $entity->get('weight')->value : 0;
default:
return $entity->id();
}
......
......@@ -46,6 +46,10 @@ class ConnectionSortKeys extends GraphQLComposeSchemaTypeBase {
'value' => 'PROMOTED',
'description' => (string) $this->t('Sort by promoted status.'),
],
'WEIGHT' => [
'value' => 'PROMOTED',
'description' => (string) $this->t('Sort by term weight.'),
],
],
]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment