stable

Clone or download

Read-only

refactor: Anonymous user cannot submit artifacts

Since anonymous users are not able anymore to submit artifacts[0], we can remove the code that rely on it during the creation of the artifact: we don't need anymore the $email parameter. No functional changes. This is a preparatory step in order to remove `\Tracker_ArtifactFactory::createArtifact` in favor of the dedicated `\Tuleap\Tracker\Artifact\Creation\TrackerArtifactCreator::create`. The idea is to move the global transaction from REST ArtifactCreator to TrackerArtifactCreator to avoid double transactions so that we are sure that we can send Mercure event *after* the artifact creation is committed. You can have a look at [the following sequence diagram][1] to have an overview of the call stack: ```mermaid flowchart LR A[ArtifactCreator::create !Transaction!]--> B[Tracker_ArtifactFactory::createArtifact] H[ArtifactCreator::createWithValuesIndexedByFieldName !Transaction!]-->B C[Tracker::importFromCSV]-->B I[Tracker_Action_CreateArtifact::createArtifact]-->B J[Tracker_Action_CreateArtifactFromModal::createArtifact]-->B K[Tracker_Artifact_MailGateway_MailGateway::createArtifact]-->B B-->D[TrackerArtifactCreator::create] E[ArtifactCreatorAdapter program]-->D L[IterationsCreator::createOneIteration]-->E M[ProgramIncrementsCreator::createOneProgramIncrement]-->E D-->F[TrackerArtifactCreator::createFirstChangesetNoValidation !Transaction!] F-->G[Plugins: ArtifactCreated!] ``` [0] See `\Tuleap\Tracker\Permission\SubmissionPermissionVerifier::checkSubmissionPermissions` [1]: https://mermaid.live/edit#pako:eNqFkt1ugjAUx1-F9VpfoBdLBMSxqTNzcRdAzAk9SDNoSSlxxPgWu9_V3m-PsCLBz-makJzS__93PtoNiSVDQkmSyXWcgtLW-CUUllmDYKA0TyDWjkLQUlEaNwH-fH1-R_3-vWUHrwrid1TLTumZT6q6U3a_o5b4cI34xnW6gKzC0hcMP5DZtccxY1PI99nsluF0OSnleSGV9pTMnfniSOIfyoo1l2LpnBRzUdzB-Xjb2aSaSAbZDcTTxUyWE-DZyKjXUB_HVyAtxjYbt0NdmVpkdK16eD7YAYNCo7IKJVcK8gbtttJx4JsDaLorz3jPAvdnjWPYOibBrKX4wuhyFPoP47nkyO-a0PunFY-rUjspiBWWqKfSPAbOdoXsrn_fqGdYo2CWVSsuSmqd0JDdRaRHclQ5cGae9KbxhESnpqKQUBMyTKDKdEhCsTVSqLSc1yImVKsKe6QqTE50OTStEJpAVuL2F5lOHnM Part of request #36805: Kanban item not found when creating a card in Kanban Change-Id: I2bd0a78e582fe964ad835a8520a2ac4ea0c692da

Modified Files

Name
M plugins/tracker/include/REST/Artifact/ArtifactCreator.php +2 −2 Go to diff View file
M plugins/tracker/include/Tracker/Action/CreateArtifact.class.php +1 −7 Go to diff View file
M plugins/tracker/include/Tracker/Action/CreateArtifactFromModal.class.php +1 −7 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/MailGateway/MailGateway.class.php +1 −1 Go to diff View file
M plugins/tracker/include/Tracker/Artifact/Tracker_ArtifactFactory.class.php +1 −5 Go to diff View file
M plugins/tracker/include/Tracker/Tracker.class.php +1 −1 Go to diff View file