stable

Clone or download

Read-only

An unknown owner ID is properly rejected by the REST API

Currently when you try to update the owner ID via the REST routes PUT /docman_embedded_files/{id}/metadata or PUT /docman_files/{id}/metadata with an incorrect ID (e.g. with 0) you get an incorrect error message and you might get an incorrect HTTP status (403 instead of 400). This contribution makes sure the returned HTTP status code is 400 and that the error message matches the behavior of the REST API. This is a part of story #13463: Split PATCH docman_items_type/id route Change-Id: I231279e7423dc487e49581425a6cc2789f67a285

Modified Files

Name
M plugins/docman/include/Docman_Actions.class.php +7 −12 Go to diff View file
R plugins/docman/include/Actions/OwnerRetriever.php Go to diff View file
M plugins/docman/include/REST/v1/DocmanEmbeddedFilesResource.php +1 −1 Go to diff View file
M plugins/docman/include/REST/v1/DocmanFilesResource.php +2 −2 Go to diff View file
M plugins/docman/include/REST/v1/Metadata/MetadataUpdator.php +24 −16 Go to diff View file
D plugins/docman/phpunit/Actions/OwnerRetrieverTest.php +0 −138 Go to diff View file
A plugins/docman/phpunit/Metadata/Owner/OwnerRetrieverTest.php +91 −0 Go to diff View file
R plugins/docman/phpunit/Metadata/HardcodedMetadataObsolescenceDateRetrieverTest.php Go to diff View file
R plugins/docman/phpunit/Metadata/HardcodedMetdataObsolescenceDateCheckerTest.php Go to diff View file
R plugins/docman/phpunit/Metadata/ItemStatusMapperTest.php Go to diff View file
R plugins/docman/phpunit/Metadata/MetadataUpdatorTest.php Go to diff View file
M plugins/docman/site-content/en_US/docman.tab +0 −1 Go to diff View file
M plugins/docman/site-content/fr_FR/LC_MESSAGES/tuleap-docman.po +6 −0 Go to diff View file
M plugins/docman/site-content/fr_FR/docman.tab +0 −1 Go to diff View file