We are currently using Drupal 8 in Acquia Platform. We are seeing issue of the Node getting locked in few scenarios, Please find them below:
#1 :
- Create an Article of Version 1 and do not publish it
- Update the same article to create Version 2 and do not publish this as well
- Again Update the same to create Version 3 and publish it. It will be successful
- Now try going back to version 2 and publish, You will get an error message "The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved."
#2 :
- Follow the same steps as above to create 3 revisions, but not publish the third one but save
- View the article and click the back button to go to the edit page
- Try to publish the version and you will see the same error message "The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved."
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 2744851-18.patch | 924 bytes | saurabh rawat |
| #16 | 2744851-16.patch | 921 bytes | saurabh rawat |
| #14 | 2744851-14.patch | 789 bytes | gaurav.kapoor |
| #11 | 2744851-11.patch | 903 bytes | pradeep22saini |
Comments
Comment #2
jacov commented+1
I can confirm that this is a reproduceable issue that needs to be fixed.
It is impacting basic Revisions functionality now in core.
@Vivek, can you please also include screenshots here?
Comment #3
jacov commentedComment #4
jacov commentedPossible custom code failure, lowering priority
Comment #5
mtmvivek commentedYes Jacob is right, This issue is with the code in the Custom Drupal Theme, Hence closing.
Comment #6
mtmvivek commentedWhen tested with the fix on the Custom Theme code, The issue is not fixed, So re-opening the issue.
Comment #7
pradeep22saini commentedSteps used to produce this issue:
1. Create a content with revisions (Moderation) enabled.
2. Create more revisions by editing and saving fields.
3. Now choose any previous revision to revert and save.
4. Now edit the node and save again.
Now there will be message:
"The content has either been modified by another user, or you have already submitted modifications. As a result, your changes cannot be saved."
Solution
I found out that validation inside this in getting failed on reverting.
core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
So, I have update the Node time changed while reverting inside this file.
core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
Any suggestion and other ways are welcome. thanks.
Comment #8
pradeep22saini commentedComment #9
pradeep22saini commentedPatch updated.
Comment #10
pradeep22saini commentedI am moving this issue to drupal Core as this is exists there and needs to be resolved.
While using Node revert using workbench modulations it is generated the isssue as explained.
Comment #11
pradeep22saini commentedTimestamp updates when revision is saved again.
Any suggestions and ways to do are welcome. thanks
Comment #12
pradeep22saini commentedComment #13
naveenvalechaUse the datetime.time service getRequestTime() method.
Undo this change.
Comment #14
gaurav.kapoor commentedComment #16
saurabh rawat commentedPlease check this patch it is working fine for me
Comment #17
saurabh rawat commentedComment #18
gaurav.kapoor commentedIndentation wrong
Comment #19
saurabh rawat commentedComment #20
saurabh rawat commentedI have changed in next patch
Comment #23
naveenvalechaThis is possibly a duplicate of #2848508: Reverting a revision causes validation error on edit form submit ?
Comment #24
naveenvalechaClosing this as duplicate of #2848508: Reverting a revision causes validation error on edit form submit
Feel free to re-open it