Manuscripts don't save
Hitting the Submit button doesn't submit the manuscript, and causes console errors. Text entered in the forms is not saved.
I investigated and found the cause: the merge function used by commonUpdateManuscript
is not working correctly. If manuscriptDelta
= { status: 'submitted' }
, the merge function will add an entry submitted: undefined
to updatedManuscript. This is because it should be iterating over keys but it's iterating over values.
However, even if that is fixed I think the code will still be broken, because it won't do a recursive merge, which is needed so that updating meta.title won't erase meta.source, for instance. (There are many such nested properties.)
commonUpdateManuscript
used to use lodash merge
, and I understand that the reason for abandoning that approach was because that function attempted to merge arrays (undesired), rather than have the new array completely replace the old one (the desired behaviour). In this case, we could do something like the solution here