Allow importing of manuscript-json that contains missing documentID references
Currently, if a document reference attribute is present but not populated with a valid reference, currently the Manuscripts Mac code will throw an NSAssert
(see managedObjectClassFromDocumentID:
in MPManagedObject.m
), and the import will fail and bring down the whole of Pressroom transiently. This manifested here: https://gitlab.com/mpapp-private/manuscripts-frontend/issues/380 where a paragraphStyle
attribute was present but contained an empty string.
-
Refactor managedObjectClassFromDocumentID:
and associated code to optionally allow importing when missing document references are present (only log the error and populate the error pointer, but do return a non-nil object back).