stable

Clone or download

Read-only

fix: be able to remove wanted reverse links at artifact update

Part of story #24970 [modal] select type for links If the user wanted to remove a reverse link while there are other reverse links already set, then the wanted link to remove is not removed and nothing change It's explained by the fact when a linked artifact is not updated then we do not update the other links. How to test: - Make sure to have at least 2 reverse links set on the tested artifact - Go to the PUT artifacts/:id route in the API Explorer - In the playload, remove one reverse link [0] - Update => The wanted reverse link is removed and the other reverse link is still linked to the tested artifact. [0] Payload example: ``` { "values": [ { "all_links": [ { "direction": "reverse", "id": 18, "type": "" }, { "direction": "forward", "id": 116, "type": "" } ], "field_id": 1329 } ] } ``` Bonus: I took the opportunity to remove some dead code in ArtifactUpdateHandler Change-Id: Ifa62f224faa38e65a96c5383626259c5a4fc7a03

Modified Files

Name
M plugins/tracker/include/REST/Artifact/PUTHandler.php +0 −4 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Link/ArtifactUpdateHandler.php +5 −33 Go to diff View file
M plugins/tracker/tests/unit/Stub/CreateNewChangesetStub.php +27 −11 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Link/ArtifactLinkerTest.php +2 −6 Go to diff View file
M plugins/tracker/tests/unit/Tracker/Artifact/Link/ArtifactUpdateHandlerTest.php +38 −7 Go to diff View file