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
When a node had two revisions and one is deleted, the tab shows still.
With only one revision present, the tab is removed.
In this case if you click on compare, there will be php errors.
Proposed resolution
Remove the tab in the case described.
Or make it always appear and deal with the situation that only one revision can be there.
Regarding the UX i would expect that i can access the revision tab always and learn about stored revisions.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#10 | diff_2424249_revision_9_test-only.patch | 1.08 KB | miro_dietiker |
#9 | 2424249-9.patch | 5.59 KB | lhangea |
#9 | interdiff-1-9.txt | 1.08 KB | lhangea |
#1 | 2424249-1.patch | 4.51 KB | lhangea |
Comments
Comment #1
lhangea CreditAttribution: lhangea commentedYea, I also think that here the better solution would be to keep the tab visible always even if there's only one revision left.
I found a similar proposed solution here: https://www.drupal.org/node/808730
I think that it's not Diff's job to show hide that tab, it's core's job to do that but until this is solved I wrote a patch that makes sure that no matter the case we will not have any errors thrown by the diff. More specifically when there's only one revision there's no possibility to compare it since there's nothing to compare it to.
Comment #2
lhangea CreditAttribution: lhangea commentedComment #3
lhangea CreditAttribution: lhangea commentedComment #4
miro_dietikerI'm confused. I can't update the issue #808730 referred by lhangea. It seems to be in a special / invalid state...
What a pity. We should push this core issue forward to allow us a nice revision/diff experience.
Patch looks fine. (Not applied, not ran tests)
Created a ticket to push maintainers to enable the 8.x testbot... #2452517: Enable testbot for 8.x branch
With fixing we should also extend the tests to go to the revisions table after deleting revisions. I think it's even a commented out part of our tests.
Comment #5
miro_dietikerComment #6
miro_dietikerThe core issue is now editable again. I added a comment with the reference.
Comment #7
miro_dietikerMake the bots test this patch.
Comment #8
miro_dietikerThe code above should fix the issue. We still should extend the test to generate the error condition.
Comment #9
lhangea CreditAttribution: lhangea commentedAdded tests to verify that the comparison feature is disabled when there is only 1 revision.
Comment #10
miro_dietikerUploading the test adding as test-only patch... so we see the testbot fail. :-)
Comment #12
miro_dietikerVery nice! Thx.
Comment #14
lhangea CreditAttribution: lhangea commented