diff --git a/modules/next/composer.json b/modules/next/composer.json index 65d7967d2..9cbdfcc0b 100644 --- a/modules/next/composer.json +++ b/modules/next/composer.json @@ -18,6 +18,7 @@ "drupal/subrequests": "^3.0" }, "require-dev": { + "drupal/consumers": "^1.0", "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0" } } diff --git a/modules/next/src/Controller/NextSiteEntityController.php b/modules/next/src/Controller/NextSiteEntityController.php index d6e280e89..19448feb0 100644 --- a/modules/next/src/Controller/NextSiteEntityController.php +++ b/modules/next/src/Controller/NextSiteEntityController.php @@ -3,6 +3,7 @@ namespace Drupal\next\Controller; use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\Url; use Drupal\next\Entity\NextSiteInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -56,10 +57,11 @@ public function environmentVariables(NextSiteInterface $next_site) { 'NEXT_IMAGE_DOMAIN' => $this->request->getHost(), ]; + $path = Url::fromRoute('entity.consumer.collection')->toString(); $variables += [ 'authentication_bearer' => '# Authentication', - 'DRUPAL_CLIENT_ID' => 'Retrieve this from /admin/config/services/consumer', - 'DRUPAL_CLIENT_SECRET' => 'Retrieve this from /admin/config/services/consumer', + 'DRUPAL_CLIENT_ID' => 'Retrieve this from ' . $path, + 'DRUPAL_CLIENT_SECRET' => 'Retrieve this from ' . $path, ]; if ($secret = $next_site->getPreviewSecret()) { diff --git a/modules/next/tests/src/Kernel/Controller/NextSiteEntityControllerTest.php b/modules/next/tests/src/Kernel/Controller/NextSiteEntityControllerTest.php index b9c694e02..e063fdd6a 100644 --- a/modules/next/tests/src/Kernel/Controller/NextSiteEntityControllerTest.php +++ b/modules/next/tests/src/Kernel/Controller/NextSiteEntityControllerTest.php @@ -18,7 +18,7 @@ class NextSiteEntityControllerTest extends KernelTestBase { /** * {@inheritdoc} */ - protected static $modules = ['next']; + protected static $modules = ['consumers', 'next']; /** * The next_site entity.