Skip to content

fix(plugins): fix getStubManuscriptObject

Ben Whitmore requested to merge broker-stub-manuscript-fix-20230822 into main

When populating blank values for the submission object, from fields specified in the form, we were failing to break the field name down into its parts. So we got a manuscript object like:

{
  id: 'abc1234blahblah',
  meta: { title: '' },
  submission: {
    'meta.title': '',
    'submission.firstAuthor': 'Joe Bloggs',
    'submission.label': '',
    ...
  },
  ...
}

We should have been discarding all fields whose name didn't start with 'submission.', and splitting off the 'submission.' when inserting into the submission object. With these fixed we get a manuscript object like this:

{
  id: 'abc1234blahblah',
  meta: { title: '' },
  submission: {
    firstAuthor: 'Joe Bloggs',
    label: '',
    ...
  },
  ...
}

Merge request reports