Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- Add a reference field to Article content configured for Page content.
- Create a Page content.
- Create an Article content with reference field pointing to Page content in #2.
- Create an Article content with reference field pointing to Page content in #2.
- 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
Issue category | Bug |
---|---|
Issue priority | Normal |
Comment | File | Size | Author |
---|---|---|---|
#2 | drupal-2473903-add-sort-for-explicit-sorting-2.patch | 2.13 KB | mradcliffe |
Comments
Comment #1
mradcliffeFix formatting in issue summary.
Comment #2
mradcliffePatch for testing.
Comment #3
mradcliffeModified issue Title to standard from meta issue.
Comment #4
amateescu CreditAttribution: amateescu for Drupal Association commentedLooks good to me.
Comment #5
alexpottCommitted ce498b9 and pushed to 8.0.x. Thanks!