-
Jérome Perrin authored
Instead of using UnrestrictedMethod for the whole duration of discoverMetadata, revert to the original user permissions for the last part where we merge revision or change state, because we want this to fail when user is not allowed. This adjusts also the high level Base_contribute script to catch these errors and report them nicely to the user and while doing this some other problems were discovered and are also fixed. Some problems in ContributionTool.newContent were fixed, this was already trying to detect that a document is going to be merged and synchronously checked that this existing document can be replaced, to display an error to the user, but this part has two issues: - first it was using getMatchedFilenamePatternDict to find the document coordinates, but this method only supports preferred_document_filename_regular_expression capturing reference, but not the combination of node_reference and local_reference, so this was changed to use getPropertyDictFromFilename, which is what is actually used to compute the reference. - The second problem here was that this check was done with a standard restricted catalog search, but later mergeRevision uses an unrestricted search, so this was changed to use unrestricted catalog search to match mergeRevision The testing also revealed that the PDFDocument._setFile hack to clear the _content_information was only for _setFile, but not for _setData, so this was extended to _setData as well, so that a case where the PDF content is updated by setData also update content information.
f33d9b66