Problem/Motivation

The test depends on a primary key sorting of the view with a relationship, but there is only one sort field added. This means the results are not guaranteed to be in the order that the test desires.

An example with nodes to reproduce manually:

  1. Add a reference field to Article content configured for Page content.
  2. Create a Page content.
  3. Create an Article content with reference field pointing to Page content in #2.
  4. Create an Article content with reference field pointing to Page content in #2.
  5. Create a Content view of Page content:
    • Add sort of Page content node id.
    • Add field of Node Id.
    • Remove title field.
    • Add reverse relationship to Article content (2nd option in views UI)
    • Add field of Node id using relationship.

The expected output is: 1 2 1 3
But the actual output can be: 1 3 1 2

Proposed resolution

Add a sort field of Node id using the relationship to the test views:

  • views.view.test_entity_reference_reverse_entity_test_view.yml
  • views.view.test_entity_reference_reverse_entity_test_mul_view.yml

Remaining tasks

  • Write Patch

User interface changes

None

API changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug
Issue priority Normal
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mradcliffe’s picture

Issue summary: View changes

Fix formatting in issue summary.

mradcliffe’s picture

Status: Active » Needs review
FileSize
2.13 KB

Patch for testing.

mradcliffe’s picture

Title: PostgreSQL: Fix Drupal\entity_reference\Tests\Views\EntityReferenceRelationshipTest » PostgreSQL: Fix entity_reference\Tests\Views\EntityReferenceRelationshipTest

Modified issue Title to standard from meta issue.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed ce498b9 and pushed to 8.0.x. Thanks!

  • alexpott committed ce498b9 on
    Issue #2473903 by mradcliffe: PostgreSQL: Fix entity_reference\Tests\...

Status: Fixed » Closed (fixed)

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