Problem/Motivation
1) Add same paragraph field to comments and node entities
2) create a view of paragraph items
3) add relationships to comment and node tables from paragraph item.
4) add node title and comment title
Expected: if paragraph item attached to node, shows node title. for paragraph item attached to comment, shows comment title
Actual: if there is a paragraph item attached to a node with the same id (nid: 15) as comment (cid: 15), it shows the node titles and the same id comment title.
Proposed resolution
I suggest we fully rely on what's views itself is doing:
All define following extra conditions for the join:
'join_extra' => array(
0 => array(
'field' => 'entity_type',
'value' => $entity_type,
),
1 => array(
'field' => 'deleted',
'value' => 0,
'numeric' => TRUE,
),
),
Remaining tasks
Needs reviews.
User interface changes
None
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2560601-paragraphs-join_extra-4.patch | 698 bytes | das-peter |
| |||
#2 | 2560601-paragraphs-join_extra-2.patch | 577 bytes | hefox |
Comments
Comment #2
hefox CreditAttribution: hefox at Phase2 commentedComment #3
jeroen.b CreditAttribution: jeroen.b at .VDMi/ commentedCould you maybe add a test for this?
Comment #4
das-peter CreditAttribution: das-peter at Cando commentedI can second this - without the entity type condition you'll get funky results once a paragraphs field is used on multiple entity types.
I suggest we fully rely on what's views itself is doing:
All define following extra conditions for the join:
Added an updated patch and updated ticket summary.
Comment #6
jstollerPatch committed to dev.