Posted by Leeteq on March 26, 2008 at 7:10pm
| Project: | Diff |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
IT would be practical to be able to make a menu entry pointing to a nodes "latest diff", meaning a URL that goes directly to the view of the current revision against the previous revision. (does this exist already? Then please enlighten me...)
So instead of having to alter the numbers (node/123/revisions/view/331/351), it could support something like node/123/revisions/view/latest
or
node/123/revisions/view/current
Comments
#1
How would you expose this feature in the UI? How would you use it?
#2
Simply make a menu entry or link to it from anywhere.
The point is to be able to not know which revision numbers are the current and the previous version, as they change dynamically.
Would be practical to have a link that pointed to the diff view of whicever is the last two revisions (current and previous). Exactly what it suggest when you enter the diff page: the two topmost revisions are always selected. When pressing "show diff" you get to that page, but next time that URL is different, if there are new revisions. So how about making a url dedicated to show the diff of the last two? The "UI" is no different, only the page we get today when clicking on show diff.
No problem if such a URL is redirecting to the normal URL style with both revision numbers in it, but the function I suggest is simply one url that will trigger a lookup to find out which are the two latest, then go straight to that "show diff" page. That URL should only contain the node id and a logical word so it is easy to rememember when making such links to several nodes.
#3
#4
Committed to 5.x and 6.x. New version issued for 5.
#5
Great, works nicely - thanks a bunch - here is a related idea for an accompanying block:
http://drupal.org/node/302989
#6
When placing links to selected nodes in a menu or block, sometimes the content manager does that to prepare for future work, not needing to wait for a minimum of two node revisions to exist for each node listed, but simply placing the nodes there so that work can commence.
With the current code, when visiting a link to a node that does not have two revisions, it returns the "access denied" page.
Instead, it should redirect to the current revision, preferably with a message on top informing that only one revision exist.
#7
#8
Here's a patch (against the latest 6.x-2.x-dev code) to handle the case where a node has only a single version.
#9
Relatedly, it would be handy to be able to easily construct a link that shows a diff between a specified vid and its predecessor.
For example, currently, to show what changed in vid 14 of node 7, you need to know that, for node 7, the previous vid was 5: node/7/revisions/view/5/14
Attached is a patch that implements an alternate syntax for this situation: node/7/revisions/view/14 --- so that you only need to know the target vid. (This patch includes the previous patch.)
#10
Here's a slight revision to the last patch, to make use of
_diff_get_previous_vid().