Skip to content
Snippets Groups Projects
Commit dd3fe872 authored by Adam G-H's avatar Adam G-H Committed by Chris Wells
Browse files

Issue #3459288: Unable to add and install a module via the drupal.org (json:api) source type

parent 23d32e17
No related branches found
No related tags found
No related merge requests found
......@@ -337,13 +337,14 @@ class InstallerController extends ControllerBase {
* Status message.
*/
public function begin(Project $project): JsonResponse {
// @todo Expand to support other plugins in https://drupal.org/i/3312354.
$source = $this->enabledSourceHandler->getCurrentSources()['drupalorg_mockapi'] ?? NULL;
if ($source === NULL) {
return new JsonResponse(['message' => "Cannot download $project->id from any available source"], 500);
}
if (!$source->isProjectSafe($project)) {
return new JsonResponse(['message' => "$project->machineName is not safe to add because its security coverage has been revoked"], 500);
if ($project->source === 'drupalorg_mockapi') {
$source = $this->enabledSourceHandler->getCurrentSources()[$project->source] ?? NULL;
if ($source === NULL) {
return new JsonResponse(['message' => "Cannot download $project->id from any available source"], 500);
}
if (!$source->isProjectSafe($project)) {
return new JsonResponse(['message' => "$project->machineName is not safe to add because its security coverage has been revoked"], 500);
}
}
$stage_available = $this->installer->isAvailable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment