stable

Clone or download

Read-only

Workflow triggers should overrule read-only field post-action

Part of story #12189 prevent field modification according to state How to test: Set up trigger rules: - Create / use a tracker hierarchy. We will call the trackers Parent and Child. - In the Parent tracker, configure triggers so that when Child artifacts change status, it updates a list field. Forge your DB for the parent tracker: - Get a transition id (for example, from "To Do" to "On going") and insert a new row in plugin_tracker_workflow_transition_postactions_read_only - Get the id you just inserted, get the list field's id (the same one that the trigger is modifying) and insert new rows in plugin_tracker_workflow_transition_postactions_read_only_fields - Create a Parent artifact. Set it to "On going" (the state of your workflow) - Link it to two Child artifacts. - When you execute the trigger conditions, the Parent artifact's list field is correctly updated by the Workflow User. - You still can't update that field with your own user (it's read-only). Change-Id: I2ad7b3bf88e8c7212639e9bb1e9fb9f87e0a1505

Modified Files

Name
M plugins/tracker/include/Tracker/Artifact/Changeset/AtGivenDateFieldsValidator.class.php +4 −3 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/FieldsValidator.class.php +13 −9 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/InitialChanagesetFieldsValidator.class.php +4 −3 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/InitialChangesetCreatorBase.class.php +5 −5 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetCreatorBase.class.php +4 −4 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetFieldsValidator.class.php +3 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetFieldsWithoutRequiredValidationValidator.php +2 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_ArtifactCreator.class.php +7 −6 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +1 −1 Go to diff View file
M plugins/tracker/include/Workflow/WorkflowUpdateChecker.php +3 −2 Go to diff View file
M plugins/tracker/phpunit/Tracker/Workflow/WorkflowUpdateCheckerTest.php +42 −7 Go to diff View file
M plugins/tracker/tests/Artifact/Changeset/FieldsValidatorTest.php +29 −15 Go to diff View file
M plugins/tracker/tests/Artifact/Tracker_ArtifactCreatorTest.php +4 −3 Go to diff View file