stable

Clone or download

Read-only

fix: empty values for list are actually none

Since the introduction of strict validation of the field dependencies [1] it breaks some assumptions regarding the way field_data are reconstructed, in case of "not complete update" like Kanban move of card. In Kanban "move card" (ie. change status) the field_data that is being passed to tracker is restricted to that new status values. But that cannot work for a proper changeset creation as, for field and workflow validation, we must have a more complete payload to analyze. This is the duty of ChangesetDataInitializator, for fields involved in Workflow, field deps & global rules, when the data are not there (new stuff being recorded) it reconstruct the data from previous changeset (or other strategies for new artifact). Until now, when a list field has never been valued, ChangesetDataInitializator was creating an empty ([]) value. However since the change of field dependencies [1] an empty value is considered as incorrect. The proposed fix turn empty value ([]) into none value ([100]) so the verification can apply. Fix request #30390 Field dependency validation must block when target value is empty Fix request #30420 Kanban transition refused due to "Global rules not valid" [1] e7add13e3afa0a6eba87558426af3687738e0445 Change-Id: Ic724cad079aa49144b624331bd4bbf138247e11e

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Changeset/ChangesetDataInitializator.class.php +11 −11 Go to diff View file
M plugins/tracker/tests/unit/Artifact/Changeset/Tracker_Artifact_Changeset_ChangesetDataInitializatorTest.php +21 −0 Go to diff View file