Bug #16378

check_override_selected checks changes not performed by user

Added by Ori Rabin over 1 year ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assigned To:Ori Rabin
Category:Smart Variables
Target version:Team Ivan Iteration 3
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3804
Story points-
Velocity based estimate-
Release1.13.1Release relationshipAuto

Description

check_override_selected is run before validations when saving a smart class parameters.
Actions that are called before validation like cast_default_value can add changed attributes that are later checked and can cause a validation message.

Steps:
1) Import puppetclass with a boolean smart class parameter with the value 't' or 'f'
2) Edit the puppetclass and click save (without any changes)

The result should be that it saves since no changes were made.
Actual result: "override must be true to edit the parameter"

This is because when saving the default value is casted and changed to 'true'.
check_override_selected catches that change as something that is not allowed unless override is true.

Associated revisions

Revision 1ebc15ea
Added by Ori Rabin over 1 year ago

Fixes #16378 - Move default_value casting to lookup_key children

Revision 8edec9ed
Added by Ori Rabin about 1 year ago

Fixes #16378 - Move default_value casting to lookup_key children

(cherry picked from commit 1ebc15ea40ebc4eaddc7afb8e83753841a724b1d)

History

#1 Updated by The Foreman Bot over 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3804 added

#2 Updated by Ivan Necas over 1 year ago

  • Target version set to Team Ivan Iteration 3

#3 Updated by Ori Rabin over 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal over 1 year ago

  • Category set to Smart Variables
  • Release set to 1.13.1

Also available in: Atom PDF