stable

Clone or download

Read-only

fix: Fatal error for project dashboards

Introduced by git #tuleap/stable/6ef5e8455161445a34a2fca059fde2ce4b682d71 Given we use urls like /projects/acme When we get the project from the request (for exemple a plugin in pre.php) Then request returns a not valid project Because there is no group_id parameter[0] In order to be able to inject the project in the request in tests in aforementioned contribution, we stored the project locally, introducing a cache, because request now always return the first retrieved project (even if in error). However somewhere in the stack, for example in the home of the project, we can assume that /projects/acme is linked to a valid project acme and might want to manually set the group_id parameter so that subsequent queries to request return the right project and not the project in error. But since the project is cached, it returns the project in error and not the valid project. This contribution make sure that when we ask the project to the request, it returns the one matching its group_id parameter. [0]: Note: the user log plugin (which is summoned by pre.php) cannot work on project dashboard because project is not known yet with current code. Part of story #35104: Milestones below Backlog Change-Id: Ia336fc2cbb8ba1b2d6d933adff46577c9183ae83

Modified Files

Name
M src/common/include/Codendi_Request.class.php +3 −2 Go to diff View file
M tests/unit/common/Include/Codendi_RequestTest.php +28 −0 Go to diff View file