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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lluisma created an issue. See original summary.

adriancid’s picture

Hi @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.

Aheleos’s picture

I'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

adriancid’s picture

Status: Active » Needs review
FileSize
686 bytes

Can you test if this patch solve the problem?

lluisma’s picture

Hi @adriancid, now it works like a charm. Thank you!

  • adriancid committed b9b00e3 on 7.x-3.x
    Issue #3116175 by adriancid: Error saving a draft
    
    
adriancid’s picture

Status: Needs review » Fixed
adriancid’s picture

Thanks

lluisma’s picture

Hello again, @adriancid

I'm sorry, but I've been creating a new node and the problem still remains.

adriancid’s picture

Status: Fixed » Needs work

Can you add more details like how to reproduce the issue and what error are you seeing?

adriancid’s picture

I'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.

lluisma’s picture

FileSize
38.13 KB

I'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?

adriancid’s picture

I really don't know how the revisions works with the moderations states yet.

ron_s’s picture

Version: 7.x-3.0 » 7.x-3.x-dev

There 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.

solideogloria’s picture

That'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.

nelsongrin’s picture

@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.

nelsongrin’s picture

I 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.

nelsongrin’s picture

Title: Error saving a draft » Error saving a draft or published revision
adriancid’s picture

Thanks @nelsongrin

adriancid’s picture

Status: Needs work » Fixed
solideogloria’s picture

Was this actually fixed, or just split into different issues?

adriancid’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.