cancel
Showing results for 
Search instead for 
Did you mean: 

Problem reducing a property from <multiple> to single

frank_d
Champ in-the-making
Champ in-the-making
We have crated a custom property of type d:text, originally defined als <multiple>true</multiple>.

Trying to change it to only allow single values causes a problem when trying to delete old nodes that were created under the original model.
Exception:

Unable to delete Space due to system error: Failed to execute transaction-level behaviour public abstract void org.alfresco.repo.node.NodeServicePolicies$OnUpdateNodePolicy.onUpdateNode(org.alfresco.service.cmr.repository.NodeRef) in transaction 25c1866e-1b32-11e1-a8f2-b7e9e5abd43b

Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: A single-valued property of this type may not be a collection


This makes sense to me as the old properties were obviously stored as collections, and now the new model is saying they should be Strings
BUt it raises the question: how to deal with an change of model of this nature? Is there a procedure to "update" old nodes to the new model? It would be OK in this case to simply preserve the first value in the collection and forget about the rest.
2 REPLIES 2

openpj
Elite Collaborator
Elite Collaborator
Before deploying the new content model you should remove or update all the old nodes created with the old content model.
Once you have updated the old nodes, then you can disable the involved model, and then update it with a new version and then you can enable it again.
To disable and enable a content model, you have to manage the Model Active property available for each model deployed as a content in the repo.

Hope this helps.

frank_d
Champ in-the-making
Champ in-the-making
Worth a try. Thank you.