Problem/Motivation
On the Change Requests tab of /node/{nid}/patches, you'll see a list of change requests. When you have the 'Edit change requests permission', 'Edit' appears in the toggle menu for patched change requests. If you click /patch/{id}/edit, you won't see the change request diffs, but you'll see a save button. When I press the save button, get an unexpected error.
Steps to reproduce
TestUser1 registers and publishes a content.
TestUser2 create a change request for that content.
TestUser1 edits its change request.
There is nothing that can be edited, but the save button is displayed, so press the button.
An error message is displayed.
The website encountered an unexpected error. Please try again later.
Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'status' cannot be null: UPDATE {patch} SET uuid=:db_update_placeholder_0, created=:db_update_placeholder_1, changed=:db_update_placeholder_2, status=:db_update_placeholder_3, rtype=:db_update_placeholder_4, rbundle=:db_update_placeholder_5, rid=:db_update_placeholder_6, rvid=:db_update_placeholder_7, uid=:db_update_placeholder_8, patch=:db_update_placeholder_9, message=:db_update_placeholder_10 WHERE id = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => 75e4ddfa-3112-45f3-a8d0-4bf09626248a [:db_update_placeholder_1] => 1616914045 [:db_update_placeholder_2] => 1616919082 [:db_update_placeholder_3] => [:db_update_placeholder_4] => node [:db_update_placeholder_5] => test_change_request_content2 [:db_update_placeholder_6] => 240 [:db_update_placeholder_7] => 553 [:db_update_placeholder_8] => 554 [:db_update_placeholder_9] => a:1:{s:22:"field_body_long_format";a:1:{i:0;a:1:{s:5:"value";s:753:"@@ -784,8 +784,703 @@ s.%3C/p%3E%0D%0A +%0D%0A%3Cp%3ESed ligula odio, elementum sit amet porta tincidunt, interdum vitae massa. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi at tortor eget augue ullamcorper accumsan sit amet et est. Vivamus in viverra eros, ac efficitur orci. Suspendisse consequat lobortis ante quis volutpat. Vestibulum fringilla lectus id massa mattis, eu pretium eros cursus. Praesent sollicitudin arcu fermentum orci finibus, at luctus ipsum cursus. Donec convallis, metus pretium imperdiet vulputate, tellus lacus imperdiet erat, non fringilla erat urna eu ipsum. Vivamus porta imperdiet lacus a posuere.%3C/p%3E%0D%0A ";}}} [:db_update_placeholder_10] => I added some sentences. [:db_condition_placeholder_0] => 3 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 846 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Thank you.
Comments
Comment #3
jfeltkampFound the issue. Normaly the edit form displays the status field (a select). But if you do not have permission 'change status of patch entities' the field was removed - and then the error occurse. I fixed that by disabeling the field instead of removing.
Fixed in 2.0.x and will be released in >=2.0.7
Thank you @s-jack for reporting the issue.
It would be nice to know more about your use case for the Change Requests module.
Comment #4
s-jack commentedI updated from 2.05 to 2.07 and the error message is no longer displayed.
Thank you.
My use case is to run a content type where users given certain roles collaborate and review each other's work.
I want to minimize the amount of time and effort required for the site operator to manage the content.
However, so far I have not been able to figure out how to use this module, so I am testing it.
For content editing, I want to adopt a management approach similar to Drupal.org's Issue management.
Comment #5
jfeltkamp