Type: Regression Bug
Affects Version/s: 6.2.X EE, 7.0.0 M3
1) Control Panel -> Documents and Media
2) Manage -> Document Types -> Add
3) Name the Document Type "Test" and add one text field. Do not make it required.
4) Publish a new document with type "Test" but don't fill in the single text field.
5) Go to Manage -> Document Types. Edit "Test" and make the text field required.
6) Edit the test document and fill in the now required field. Click Publish.
EXPECTED: the document saves correctly with the fields filled in.
ACTUAL: an error displays "Your request failed to complete."
The issue is that the null metadata value is being saved in step 4. Then, when you edit the document in step 6, it calls DLFileEntryLocalServiceImpl.copyFileEntryMetadata and creates a new metadata based off of the previous metadata and then proceeds to update it. When copying the previous metadata and creating a new one, it runs through BaseStorageAdapter.validateDDMStructureFields which fails since the field is required but null.