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.
After upgrading to 7.x-3.0 from 7.x-3.0-rc2, when I save an article as a draft, Drupal shows an error page like:
"Deleted X revisions.
The website encountered an unexpected error. Please try again later."
howerver, if I set the moderation state as 'Published' before, it saves the content correctly.
Comment | File | Size | Author |
---|---|---|---|
#12 | revisions.png | 38.13 KB | lluisma |
#4 | node_revision_delete-error_saving_draft-3116175-4-D7.patch | 686 bytes | adriancid |
Comments
Comment #2
adriancidHi @lluisma thanks for reporting, I don't see any change related to your problem between 7.x-3.0rc2 and 7.x-3.0, are you sure the problem is not present in 7.x-3.0rc2?
Consider using the next time you report an issue the Issue Summary Template.
Comment #3
Aheleos CreditAttribution: Aheleos commentedI'm having the same issue when saving a draft, including when setting it to needs review. It also seems to be deleting all old revisions regardless of the setting.
Notice: Undefined index: landing_page in node_revision_delete_workbench_moderation_transition() (line 300 of
Comment #4
adriancidCan you test if this patch solve the problem?
Comment #5
lluisma CreditAttribution: lluisma commentedHi @adriancid, now it works like a charm. Thank you!
Comment #7
adriancidComment #8
adriancidThanks
Comment #9
lluisma CreditAttribution: lluisma commentedHello again, @adriancid
I'm sorry, but I've been creating a new node and the problem still remains.
Comment #10
adriancidCan you add more details like how to reproduce the issue and what error are you seeing?
Comment #11
adriancidI'm not using now D7 and I'm putting all my free time on the D8 version, so will be great if you can try to fix the issue and provide a patch.
Comment #12
lluisma CreditAttribution: lluisma commentedI'm trying to understand what's the problem and I have a question about the behavior of node revisions.
After you disable the module, editi a node and save it as a draft, two new revisions appear in the revision history: one as the published revision, and another one as the current revision (state Draft). Both with same date. (image attached)
Is this the expected behavior, or should it really create only one revision?
Comment #13
adriancidI really don't know how the revisions works with the moderations states yet.
Comment #14
ron_s CreditAttribution: ron_s commentedThere is definitely something wrong here. After saving a new draft, it displays the same information as the published version, even though when editing the draft it shows the correct text.
Comment #15
solideogloria CreditAttribution: solideogloria commentedThat's how saving drafts has behaved, for the last couple years, at least... That's what it does for me too, just like the screenshot.
Does the Node Revisions error still occur? "Deleted X revisions. The website encountered an unexpected error. Please try again later."
If not, call this issue fixed.
Comment #16
nelsongrin CreditAttribution: nelsongrin at European Commission and European Union Institutions, Agencies and Bodies for European Commission and European Union Institutions, Agencies and Bodies commented@lluisma
That's the expected behavior since workbench moderation works with drafty module.
So when creating a draft, you will have a published revision automatically added on top as well.
Comment #17
nelsongrin CreditAttribution: nelsongrin at European Commission and European Union Institutions, Agencies and Bodies for European Commission and European Union Institutions, Agencies and Bodies commentedI have this issue as well, and I will describe the reason for it.
If I configure the module to delete revisions older than 6 months, and I have a node with only two revisions older than 6 months for example, when saving the node with draft or published status, he will try to delete the two revisions, but the new revision is not yet in the database, especially in workbench_moderation_node_history table that contains the statuses of what is current and what is published, and as consequence he will try to delete a revision that is still current, causing the error.
Please have a look to the issue Updating nodes deletes revisions and using a wrong hook where I describe a full list of problems related to this hook and my proposal as well to fix it.
Comment #18
nelsongrin CreditAttribution: nelsongrin at European Commission and European Union Institutions, Agencies and Bodies for European Commission and European Union Institutions, Agencies and Bodies commentedComment #19
adriancidThanks @nelsongrin
Comment #20
adriancidComment #21
solideogloria CreditAttribution: solideogloria commentedWas this actually fixed, or just split into different issues?
Comment #22
adriancid@solideogloria check #3134728: Updating nodes deletes revisions and using a wrong hook and #3134776: Current revision from workbench moderation is not excluded I will review soon this 2 issues.
Comment #23
nelsongrin CreditAttribution: nelsongrin at European Commission and European Union Institutions, Agencies and Bodies for European Commission and European Union Institutions, Agencies and Bodies commentedThanks @adriancid