Actions
Bug #2003
closedSelect in PT editor throws exception if item name are not found
Status:
Rejected
Priority:
2
Assignee:
-
Category:
Web - Config management
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
If a <select> is configured in a PT, and a value not available in its list of item was saved at some point in the PI, then the SelectField editor failed with an exception.
In the following example, the select is defined like that:
<SELECT> <NAME>USERDIRPERM_USER_SETPERM</NAME> <DESCRIPTION>Set automatically permissions on this user directory</DESCRIPTION> <ITEM> <VALUE>setPerm</VALUE> LABEL>Set permissions on user directory</LABEL> </ITEM> </SELECT>
And the exception is:
java.util.NoSuchElementException: key not found: setPerms at scala.collection.MapLike$class.default(MapLike.scala:224) ~[scala-library-2.9.0-1.jar:na] at scala.collection.immutable.Map$Map1.default(Map.scala:106) ~[scala-library-2.9.0-1.jar:na] at scala.collection.MapLike$class.apply(MapLike.scala:135) ~[scala-library-2.9.0-1.jar:na] at scala.collection.immutable.Map$Map1.apply(Map.scala:106) ~[scala-library-2.9.0-1.jar:na] at com.normation.rudder.web.model.SelectField$$anonfun$3.apply(PolicyFieldEditors.scala:145) ~[classes/:na] at com.normation.rudder.web.model.SelectField$$anonfun$3.apply(PolicyFieldEditors.scala:145) ~[classes/:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34) ~[scala-library-2.9.0-1.jar:na] at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:33) ~[scala-library-2.9.0-1.jar:na] at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.mutable.WrappedArray.map(WrappedArray.scala:33) ~[scala-library-2.9.0-1.jar:na] at com.normation.rudder.web.model.SelectField.toForm(PolicyFieldEditors.scala:145) ~[classes/:na] at com.normation.rudder.web.model.SelectField.toForm(PolicyFieldEditors.scala:132) ~[classes/:na] at com.normation.rudder.web.model.PolicyField$class.toFormNodeSeq(PolicyEditor.scala:143) ~[classes/:na] at com.normation.rudder.web.model.SelectField.toFormNodeSeq(PolicyFieldEditors.scala:132) ~[classes/:na] at com.normation.rudder.web.model.SectionFieldImp$$anonfun$2.apply(PolicyEditor.scala:215) ~[classes/:na] at com.normation.rudder.web.model.SectionFieldImp$$anonfun$2.apply(PolicyEditor.scala:215) ~[classes/:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library-2.9.0-1.jar:na] at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library-2.9.0-1.jar:na] at scala.collection.TraversableLike$class.map(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.immutable.List.map(List.scala:45) ~[scala-library-2.9.0-1.jar:na] at com.normation.rudder.web.model.SectionFieldImp.toFormNodeSeq(PolicyEditor.scala:215) ~[classes/:na] at com.normation.rudder.web.model.MultivaluedSectionField$$anonfun$com$normation$rudder$web$model$MultivaluedSectionField$$showFormEntry$1.apply(PolicyEditor.scala:360) ~[classes/:na] at com.normation.rudder.web.model.MultivaluedSectionField$$anonfun$com$normation$rudder$web$model$MultivaluedSectionField$$showFormEntry$1.apply(PolicyEditor.scala:360) ~[classes/:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194) ~[scala-library-2.9.0-1.jar:na] at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) ~[scala-library-2.9.0-1.jar:na] at scala.collection.immutable.List.foreach(List.scala:45) ~[scala-library-2.9.0-1.jar:na]
Actions