MantisBT: master 9d4a140f

Author Committer Branch Timestamp Parent
dregad dregad master 2023-08-18 11:18 master 33dbef25
Affected Issues  0032835: REST API errors when attempting to add or delete issue relationships
Changeset

relationship_get() throw Exception if not found

Until now, when the given $p_relationship_id did not exist, the function
would just return null.

This caused REST API DELETE /{id}/relationships/{relationship_id}
endpoint to return HTTP 200 despite actually failing due to a PHP
Warning: Attempt to read property "src_bug_id" on null in
./core/relationship_api.php on line 598

relationship_get() now throws a ClientException instead, and API returns
a 404.

Fixes 0032835

mod - core/relationship_api.php Diff File