-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 10.10-HF72, 2023.0, 2021.35
-
Component/s: Directory
-
Release Notes Summary:A parent directory entry of which all children are obsolete is now returned if 'canSelectParent' is true
-
Tags:
-
Backlog priority:650
-
Sprint:nxplatform #83
-
Story Points:3
Steps to reproduce :
- define a hierarchical vocabulary with this content
"id","label","parent","obsolete" "veg","Végétale","","0" "palm","Huile de palme","veg","1" "ani","Animale","","0" "porc","Porc","ani","0" "boeuf","Boeuf","ani","0" "autre","Autre","",0
- run this query
curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/automation/Directory.SuggestEntries' -H 'Accept: application/json' -H 'Content-type: application/json' -H 'X-NXRepository: default' -H 'properties: *' --data-raw '{"params":{"directoryName":"myvoc","dbl10n":false,"localize":true,"lang":"fr","searchTerm":"","canSelectParent":true},"context":{}}'
- observe that the parent "veg" is not returned because its only children "palm" is obsolete
[ { "absoluteLabel" : "Animale", "children" : [ { "absoluteLabel" : "Animale/Boeuf", "computedId" : "ani/boeuf", "directoryName" : "myvoc", "displayLabel" : "Boeuf", "entity-type" : "directoryEntry", "id" : "boeuf", "label" : "Boeuf", "obsolete" : 0, "ordering" : 10000000, "parent" : "ani", "properties" : { "id" : "boeuf", "label" : "Boeuf", "obsolete" : 0, "ordering" : 10000000, "parent" : "ani" } }, { "absoluteLabel" : "Animale/Porc", "computedId" : "ani/porc", "directoryName" : "myvoc", "displayLabel" : "Porc", "entity-type" : "directoryEntry", "id" : "porc", "label" : "Porc", "obsolete" : 0, "ordering" : 10000000, "parent" : "ani", "properties" : { "id" : "porc", "label" : "Porc", "obsolete" : 0, "ordering" : 10000000, "parent" : "ani" } } ], "computedId" : "ani", "directoryName" : "myvoc", "displayLabel" : "Animale", "entity-type" : "directoryEntry", "id" : "ani", "label" : "Animale", "obsolete" : 0, "ordering" : 10000000, "parent" : "", "properties" : { "id" : "ani", "label" : "Animale", "obsolete" : 0, "ordering" : 10000000, "parent" : "" } }, { "absoluteLabel" : "Autre", "computedId" : "autre", "directoryName" : "myvoc", "displayLabel" : "Autre", "entity-type" : "directoryEntry", "id" : "autre", "label" : "Autre", "obsolete" : 0, "ordering" : 10000000, "properties" : { "id" : "autre", "label" : "Autre", "obsolete" : 0, "ordering" : 10000000 } } ]
It makes sense not to return a parent with all obsolete children when the parent cannot be selected. But if one can choose a parent, it should be return in this case.