Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
PortCMIS 0.3.0
-
None
-
None
Description
When Saving and retrieving the files that contains document properties with multi choices we are getting an below exception
"The given key 'value' was not present in the dictionary."
Please be kind enough to provide a urgent fix to resolve this issue with a Nuget package.
Analysis and temporary fix which we are suggesting
After deeper analysis into CMIS client library, We found that "value" key attribute is missing (sample choice is given below (it's a nested choice)), In that scenario of saving and retrieving the files that contains document properties with multi choices.
PortCMIS library mandatorily expects the "value" key to be present for all "choice" elements present in the metadata. But it is missing (highlighted in red).
"choice":{
{
"displayName":"Certificate Items",
"value":[choice value],
"choice":[
{"displayName":"Certificate","value":"Certificate"},
{"displayName":"EE Certificate","value":"EE Certificate"},¬¬
{"displayName":"DP Certificate","value":"DP Certificate"}
]
}
}
For the above issue, Temporarily, below highlighted code has been added as condition to ensure choice list with no values in json string are skipped
File Name :PortCMIS\binding\browser\BrowserConverter.cs
if (choiceJson.ContainsKey(BrowserConstants.JsonPropertyTypeChoiceValue))
{
object choiceValue = choiceJson[BrowserConstants.JsonPropertyTypeChoiceValue];
List<string> values = new List<string>();
if (choiceValue is JsonArray)
{
foreach (object value in (JsonArray)choiceValue)
}
else
choice.Value = values;
{color:#de350b}}