QueryTrait.php contains this todo


  public function prepare() {
    parent::prepare();
    $entity_type = $this->entityManager->getDefinition($this->entityTypeId);
    $revision_key = $entity_type->getKey('revision');

    $revision_query = FALSE;
    foreach ($this->condition->conditions() as $condition) {
      if ($condition['field'] == $revision_key) {
        $revision_query = TRUE;
      }
    }

    // Loading a revision is explicit. So when we try to load one we should do
    // so without a condition on the deleted flag.
    if (!$revision_query) {
      $this->condition('_deleted', (int) $this->isDeleted);
    }
    $current_request = \Drupal::service('request_stack')->getCurrentRequest();
    $form_id = $current_request->request->get('form_id');
    // Don't add this condition when a user tries to login.
    // @todo: See if there is a cleaner way to detect login.
    if ($form_id != 'user_login_form') {
      $this->condition('workspace', $this->workspaceId ?: \Drupal::service('multiversion.manager')->getActiveWorkspaceId());
    }
    return $this;
  }

And ContentEntityStorageTrait.php contains something similar in buildQuery():

<?php
    // Entities in other workspaces than the active one can only be queried with
    // the Entity Query API and not by the storage handler itself.
    $current_request = \Drupal::service('request_stack')->getCurrentRequest();
    $form_id = $current_request->request->get('form_id');
    // Don't add this condition when an user tries to login.
    // @todo: {@link https://www.drupal.org/node/2597456 See if there is a
    // cleaner way to detect login.}
    if ($form_id != 'user_login_form') {
      $query->condition("$revision_alias.workspace", $this->getActiveWorkspaceId());
    }
    return $query;

?>

Comments

stevector created an issue. See original summary.

stevector’s picture

Issue summary: View changes
dixon_’s picture

Status: Active » Fixed

This was fixed in an earlier pull request coming in from Github.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.