Browse Source

Bit of other paranoia with aliases.

pull/1011/head
Adam Vessey 9 months ago
parent
commit
d5aeca0fb8
No known key found for this signature in database
GPG Key ID: 89B39535BF6D0D39
  1. 8
      src/Plugin/views/filter/NodeHasMediaUse.php

8
src/Plugin/views/filter/NodeHasMediaUse.php

@ -84,10 +84,10 @@ class NodeHasMediaUse extends FilterPluginBase {
return;
}
$sub_query = \Drupal::database()->select('media', 'm');
$sub_query->join('media__field_media_use', 'use', 'm.mid = use.entity_id');
$sub_query->join('media__field_media_of', 'of', 'm.mid = of.entity_id');
$sub_query->fields('of', ['field_media_of_target_id'])
->condition('use.field_media_use_target_id', $term->id());
$use_alias = $sub_query->join('media__field_media_use', 'use', 'm.mid = %alias.entity_id');
$of_alias = $sub_query->join('media__field_media_of', 'of', 'm.mid = %alias.entity_id');
$sub_query->fields($of_alias, ['field_media_of_target_id'])
->condition("{$use_alias}.field_media_use_target_id", $term->id());
/** @var \Drupal\views\Plugin\views\query\Sql $query */
$query = $this->query;

Loading…
Cancel
Save