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.
Hello,
I just upgrated views from version 3.3 to 3.5. I had created a view that lists up the node revisions in a table with some information. After the upgrate the view stopped working correctly.
I tried to create a new view that does the same trick but that view would only display the latest revision of each node for me.
I hope this will get fixed in the next revision :-)
Best regards,
Bjarki
Comment | File | Size | Author |
---|---|---|---|
#16 | views-1754354-16.patch | 2.19 KB | dawehner |
#14 | views-1754354-14.patch | 6.48 KB | dawehner |
#8 | 1754354-views-node-revision-nid.8.patch | 11.69 KB | andypost |
#7 | 1754354-views-node-revision-nid.7.patch | 2.42 KB | andypost |
#6 | 1754354-views-node-revision-nid.6.patch | 2.19 KB | andypost |
Comments
Comment #1
dawehnerCould you please post an export of your view? You know we would like to understand what you did.
Comment #2
manuelBS CreditAttribution: manuelBS commentedThe same for me. I just updated. The view told me that there where some relations added and I have to check if everything is ok but it isn't. My view is only showing the latest revision, but not a list of all revisions. Before the update it worked.
Comment #3
esmerel CreditAttribution: esmerel commentedComment #4
PatchRanger CreditAttribution: PatchRanger commentedIndeed.
As you could see it becomes broken after this commit : http://drupalcode.org/project/views.git/commit/e2a1e453441e3969b8235398e... , where mistakenly was changed base field of relationship.
Here you are a patch that fixes this bug and prevents others.
Comment #5
andypost@Staratel Take a look at patch #1321288-7: How to: make views get and display ALL revisions of a given content (now: views only gets the latest revision)
Supposse much better to describe a node_revision.NID field for views.
After #1547726: Kill implicit relationship from node to node_revision this ability was lost
Comment #6
andypostMarked as duplicate #1321288-7: How to: make views get and display ALL revisions of a given content (now: views only gets the latest revision)
This patch introduces node_revision.NID field for Views-data
Comment #7
andypostPatch introduces 2 different relations:
1) default on NID as it was before regression
2) on VID to query only active revisions
Comment #8
andypostSame patch with test
Comment #9
andypostThis really critical because changed behavior could break views used in rules and cause a data loss
Comment #10
B-Prod CreditAttribution: B-Prod commentedI applied the patch on the current release (not DEV version) and it fixes the issue as expected.
Comment #11
dawehner* Removed the debug messages out of the test and committed to 7.x-3.x
This needs for sure a port towards d8.
Comment #12
tanmaykI have applied the patch in #4, worked for me :-)
But getting debug on view page.
Debug:
'Handler views_handler_field_node_revision tried to add additional_field nid but node could not be added!'
in views_handler_field->add_additional_fields() (line 142 of /svn/sharp_crm/trunk/www/sites/all/modules/contrib/views/handlers/views_handler_field.inc).
Comment #13
dawehnerAssign the port to myself as i require this views data in another test :)
Comment #14
dawehnerHere is a port of the patch and the test.
Comment #15
aspilicious CreditAttribution: aspilicious commentedcan we have test only? please? :p
Comment #16
dawehnerLet's break it
Comment #18
dawehnerBack to needs review.
Comment #19
aspilicious CreditAttribution: aspilicious commentedLooks good :)
Comment #20
dawehnerThank you for the review and the patch for 7.x-3.x
Committed and pushed.
Comment #22
johnvI posted the following follow-ups:
#1827602: Better descriptions for new 'Content revision' relationships.
#1827586: Add 'known issue' to release notes of release 3.5, due to 'corrupts Entity Revisions views'.
Comment #23
partdigital CreditAttribution: partdigital commentedI applied the patch from #7 on views 3.5 and I still could only see the latest revisions. None of the others.
Comment #24
a.milkovsky#4 works for me, thanks!
I applied the patch from #4 on views 3.5 and flushed all caches
Comment #25
pianomansam CreditAttribution: pianomansam commentedAny chance we can get a new version of 7.x rolled that includes this patch?
Comment #26
johnvI checked views 3.6, and the patch is included in that version.
Comment #27
brandy.brown CreditAttribution: brandy.brown commented#4 worked for me. Although now it's display a ton of the same revision, but that's probably some other issue.
Comment #28
leex CreditAttribution: leex commentedI still have this issue in views 3.7 where just 1 revision is returned.
Comment #29
Tschet CreditAttribution: Tschet commentedI'm also using 3.7 and seeing only the newest revisions.
Comment #30
Bojhan CreditAttribution: Bojhan commentedI am also only getting the latest revision. I've pasted my view below it seems like the NID is being picked up but only for the first revision.
Comment #31
Bojhan CreditAttribution: Bojhan commentedDawhener found several bugs, this seems to resolve it for me (in my D7 install I fixed it too):
#2229167: Broken/missing handler (Module: node) …
#2229173: node_revision.status should|title be node_field_revision.status|title
Comment #32
rooby CreditAttribution: rooby commentedI'm also only getting one result per node on a content revisions view using 3.7
Comment #33
granticusiv CreditAttribution: granticusiv commentedI don't know if this will help your particular case rooby, but I found I had to remove the "(Get the actual content from a content revision.) Content: Published (Yes)" filter that's included by default with a new Content Revisions view.
If adding a contextual filter, I had to use "Content revision: Nid", not "Content: Nid".
Using Views 3.7
Comment #34
murilowadt CreditAttribution: murilowadt commentedIn my case, I needed to use all "Content Revision:" fields instead of "Content:". For instance Content Revision: Title instead of Content: Title.
Hope this helps. Did not used contextual filters and it's working with 3.7 and 3.8 Views Module.
Comment #35
pinkonomy CreditAttribution: pinkonomy commentedI am using Views 3.7 and my view shows only the latest revision.Anyone help on this?
Comment #36
murilowadt CreditAttribution: murilowadt commented#33 worked to me. Just removed the default filter "(Get the actual content from a content revision.) Content: Published (Yes)" and it started to show all revisions.
Comment #37
paulmckibbenI am seeing this in Views 3.10. It shows only the latest revision if I add a filter on content type, i.e. "(Get the actual content from a content revision.) Content: Type (= [Type Name])."
Expected behavior: it should be possible to filter content revisions on properties and fields.
Comment #38
paulmckibbenFound a fix: there were two different relationships available with the same human-readable name, "Get the actual content from a content revision." The default relationship used the revision ID (vid) for joining the node and node_revision tables. This excluded all revisions other than the most recent. I deleted that relationship and used the one that uses the content ID (nid) for joining the node and node_revision tables, and that relationship did the trick.
Comment #39
joekers@paulmckibben Was this on a 'content_revision' view or a normal 'content' view? I'm using a normal content view and I'm trying to show the latest revision of content (drafts), however I can only show the current revision.
I've tried adding the relationship using the revision ID (vid) and it shows multiple revisions of the same node but the content of all of the fields are the current revision instead of the latest revision.
Comment #40
thomasmurphy CreditAttribution: thomasmurphy commented#33 worked for me, thanks!
Comment #41
dgtlmoon CreditAttribution: dgtlmoon commentedComment #42
LendudeThis is already in D8 core, so moving it back to 7.x-3.x as a support request.
Comment #43
katski CreditAttribution: katski commented@paulmckibben comments worked for me (#37, #38) - this is on a content revisions view.
Comment #44
foredoc CreditAttribution: foredoc commentedComment from #38 works for me.
Thanks.
Comment #45
jiv_e CreditAttribution: jiv_e as a volunteer and commentedSeems to work already. See #33 and #38. Closing.
Comment #47
usmanjutt84#33 work for me
Comment #48
Darren Oh