stable
Clone or download
Part of story #12189 prevent field modification according to state How to test: Build (or import) a tracker with all fields. You should test: - string - text (HTML format or Text) - artifact link - computed (manual and autocomputed) - date - file - selectbox - radio button - multi selectbox - checkbox - open list float, int and permissions on artifact are bugged [0] For each of those fields, forge your DB: - 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 field ids and insert new rows in plugin_tracker_workflow_transition_postactions_read_only_fields Now, create an artifact for this tracker and set its "status" (or whatever field defines the workflow) to "On going" (same as the "to" for your transition above). Once the artifact is "On going", when you try to edit the read-only fields defined above, the backend should stop you with a feedback "Fields are not valid" [O]: Known issues: - If you configure a float, int or permissions on artifact field as read-only in the workflow, you won't be able to update the artifact anymore. Those fields do not identify changes correctly, even when you don't change the value they will be marked as changed. Change-Id: I693779f8cda33da7eeb6422bacd20e53b9503723
Modified Files
Name | ||||
---|---|---|---|---|
M | plugins/tracker/include/REST/v1/Workflow/TransitionsResource.class.php | +8 | −20 | Go to diff View file |
M | plugins/tracker/include/Tracker/Artifact/Changeset/NewChangesetFieldsValidator.class.php | +28 | −3 | Go to diff View file |
M | plugins/tracker/include/Tracker/Artifact/Tracker_Artifact.class.php | +31 | −5 | Go to diff View file |
M | plugins/tracker/include/Tracker/Tracker.class.php | +29 | −3 | Go to diff View file |
M | plugins/tracker/include/Workflow/PostAction/PostActionsRetriever.php | +25 | −4 | Go to diff View file |
A | plugins/tracker/include/Workflow/PostAction/ReadOnly/NoReadOnlyFieldsPostActionException.php | +25 | −0 | Go to diff View file |
M | plugins/tracker/include/Workflow/PostAction/ReadOnly/ReadOnlyFieldsFactory.php | +1 | −1 | Go to diff View file |
A | plugins/tracker/include/Workflow/Transition/NoTransitionForStateException.php | +25 | −0 | Go to diff View file |
M | plugins/tracker/include/Workflow/Transition/Update/TransitionReplicatorBuilder.php | +5 | −2 | Go to diff View file |
M | plugins/tracker/include/Workflow/Transition/Update/TransitionRetriever.php | +18 | −1 | Go to diff View file |
M | plugins/tracker/include/Workflow/Workflow.class.php | +19 | −0 | Go to diff View file |
A | plugins/tracker/include/Workflow/WorkflowUpdateChecker.php | +98 | −0 | Go to diff View file |
M | plugins/tracker/include/Workflow/Workflow_TransitionDao.class.php | +16 | −0 | Go to diff View file |
A | plugins/tracker/phpunit/Tracker/Workflow/WorkflowUpdateCheckerTest.php | +357 | −0 | Go to diff View file |
M | plugins/tracker/tests/Artifact/Changeset/FieldsValidatorTest.php | +10 | −7 | Go to diff View file |
M | plugins/tracker/tests/Tracker_ArtifactTest.php | +28 | −7 | Go to diff View file |