Counterpart of bug 29146
Created attachment 127035 [details] [review] Bug 29334: Do not apply defaultvalue to existing auth record Note: The check in build_authorized_values_list with defaultvalue can be simplified since $value may already contain the defaultvalue. It is filled before the sub is called. The test for inserting a blank option is generalized; and may be still improved when using required attributes in the template? Note that we might experience some browser issues for these placeholders. Removed a few useless lines with respect to fields controlled by itemtypes. The last assignment to $value was useless and its probable intention unwanted (just use defaultvalue). Test plan: Put a defaultvalue in an authority framework. Add a new authority. Check for that value. Open existing authority. Clear field, save and reopen. Check if field is still empty. Bonus: test field controlled by authorised values. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 127044 [details] [review] Bug 29334: Do not apply defaultvalue to existing auth record Note: The check in build_authorized_values_list with defaultvalue can be simplified since $value may already contain the defaultvalue. It is filled before the sub is called. The test for inserting a blank option is generalized; and may be still improved when using required attributes in the template? Note that we might experience some browser issues for these placeholders. Removed a few useless lines with respect to fields controlled by itemtypes. The last assignment to $value was useless and its probable intention unwanted (just use defaultvalue). Test plan: Put a defaultvalue in an authority framework. Add a new authority. Check for that value. Open existing authority. Clear field, save and reopen. Check if field is still empty. Bonus: test field controlled by authorised values. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Note: tested using authorised values and everything worked as expected (after the patch was applied)
Created attachment 127581 [details] [review] Bug 29334: Do not apply defaultvalue to existing auth record Note: The check in build_authorized_values_list with defaultvalue can be simplified since $value may already contain the defaultvalue. It is filled before the sub is called. The test for inserting a blank option is generalized; and may be still improved when using required attributes in the template? Note that we might experience some browser issues for these placeholders. Removed a few useless lines with respect to fields controlled by itemtypes. The last assignment to $value was useless and its probable intention unwanted (just use defaultvalue). Test plan: Put a defaultvalue in an authority framework. Add a new authority. Check for that value. Open existing authority. Clear field, save and reopen. Check if field is still empty. Bonus: test field controlled by authorised values. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All working as expected, no regressions found and the QA scripts are happy. Passing QA
Pushed to master for 21.11, thanks to everybody involved!