Bug #8052
closed
Smart class parameters with ERB snippets are broken for other that String types
Added by Petr Chalupa about 10 years ago.
Updated over 6 years ago.
Description
Smart class parameters currently have broken validation and type-casting when used with ERB snippets. It tries to validate the value with the ERB without evaluation when key is being saved. It was hacked around it in Staypuft. How to fix it: Validation and type-casting has to be done on classification when ERB can be evaluated; SafeRender needs to be aware of the ERB parameters, they need to be validated and properly type-casted based on the given KeyValue (this association is missing currently).
The hack for Staypuft is in this file https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/concerns/lookup_key_extensions.rb
- Category set to Parameters
- Priority changed from High to Normal
- Status changed from New to Assigned
- Assignee set to Marek Hulán
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2080 added
- Pull request deleted (
)
- Bugzilla link set to 1183643
- Blocked by Bug #9044: Tests can fail randomly on mac.succ added
- Translation missing: en.field_release set to 32
- Related to Refactor #9142: Unify validate_regexp and validate_list for lookup value/key added
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Related to Bug #10088: Smart class default parameter interpreted as string added
- Related to Bug #9673: YAML type casting fails for lookup values in 1.7.3 added
- Related to Bug #9787: Default values of smart class parameters can't be JSON or YAML added
Also available in: Atom
PDF