[Bug with Fix] Integrity violations - invalid property value found on "cm:name" during upload of folder with empty space #2106
Description
In recent months I am frequently encountering the error I highlighted in this post:
https://hub.alfresco.com/t5/alfresco-content-services-forum/integrity-violations-invalid-property-value-found-on-quot-cm/m-p/315150
Thanks to menczingerm I found out what the problem is:
This is the constrait for cm:name property
from the contentModel.xml
<constraints>
<constraint name="cm:filename" type="REGEX">
<parameter name="expression"><value><![CDATA[(.*[\"\*\\\>\<\?\/\:\|]+.*)|(.*[\.]?.*[\.]+$)|(.*[ ]+$)]]></value></parameter>
<parameter name="requiresMatch"><value>false</value></parameter>
</constraint>
<constraint name="cm:userNameConstraint" type="org.alfresco.repo.dictionary.constraint.UserNameConstraint" />
<constraint name="cm:authorityNameConstraint" type="org.alfresco.repo.dictionary.constraint.AuthorityNameConstraint" />
<constraint name="cm:storeSelectorConstraint" type="REGISTERED">
<parameter name="registeredName"><value>defaultStoreSelector</value></parameter>
</constraint>
</constraints>
Tested via RestApi and CMIS browserbind calls and as expected Alfresco will trim the space from the end of the filename, when you try to upload a folder in Share UI then it do not trim the spaces at the end of the folder name so you will receive this error.
Constraint: 002013695 Value '2020 ACCERT. RES. MINORI X ACQUISIZ. CITT. ITA ' is not valid as a file name. This property must be a valid file name.
The space is the problem at the end of the filename, i am forced to preprocess the file/folder name values before the upload.
This issue is solved with this PR: #1988