stable

Clone or download

Read-only

Do not display xref to unreachable forum message

Given an artifact is referenced by (or is referencing with `msg #123`) a forum message, When the user displays the artifact, Then the subject of the message is displayed instead of the raw xref. Given an artifact is referenced by (or is referencing with `msg #123`) a forum message, And the user is not allowed to access the message (private forum, or no access to the project) When the user displays the artifact, Then the xref is not displayed. Note: in order to not loose to much hair by understanding/refactoring existing code in order to retrieve a given message, it has been moved as-is in a dedicated object. This object is using db_query and legacy functions, so no unit tests have been added. There should be no functional changes on the display of a forum message. Part of story #17180 take into account gitlab commits Change-Id: I36a322c3df34159ce8a437d3576de259d797e2cd

Modified Files

Name
M plugins/tracker/include/Tracker/FormElement/Tracker_FormElement_Field_CrossReferences.php +6 −0 Go to diff View file
A src/common/Forum/Message.php +122 −0 Go to diff View file
A src/common/Forum/MessageNotFoundException.php +27 −0 Go to diff View file
A src/common/Forum/MessageRetriever.php +84 −0 Go to diff View file
A src/common/Forum/PermissionToAccessForumException.php +27 −0 Go to diff View file
M src/common/Reference/ByNature/CrossReferenceByNatureInCoreOrganizer.php +15 −5 Go to diff View file
A src/common/Reference/ByNature/Forum/CrossReferenceForumOrganizer.php +72 −0 Go to diff View file
M src/www/forum/message.php +22 −42 Go to diff View file
M tests/psalm/tuleap-baseline.xml +19 −24 Go to diff View file
M tests/unit/common/Reference/ByNature/CrossReferenceByNatureInCoreOrganizerTest.php +44 −15 Go to diff View file
A tests/unit/common/Reference/ByNature/Forum/CrossReferenceForumOrganizerTest.php +145 −0 Go to diff View file