Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / node / src / Plugin / views / filter / UidRevision.php
1 <?php
2
3 namespace Drupal\node\Plugin\views\filter;
4
5 use Drupal\user\Plugin\views\filter\Name;
6
7 /**
8  * Filter handler to check for revisions a certain user has created.
9  *
10  * @ingroup views_filter_handlers
11  *
12  * @ViewsFilter("node_uid_revision")
13  */
14 class UidRevision extends Name {
15
16   public function query($group_by = FALSE) {
17     $this->ensureMyTable();
18
19     $placeholder = $this->placeholder() . '[]';
20
21     $args = array_values($this->value);
22
23     $this->query->addWhereExpression($this->options['group'], "$this->tableAlias.uid IN($placeholder) OR
24       ((SELECT COUNT(DISTINCT vid) FROM {node_revision} nr WHERE nr.revision_uid IN ($placeholder) AND nr.nid = $this->tableAlias.nid) > 0)", [$placeholder => $args],
25       $args);
26   }
27
28 }