Skip to content
Snippets Groups Projects
Unverified Commit 049ddc9d authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3099971 by huzooka: Hard-coded uri string in WorkflowListBuilder breaks...

Issue #3099971 by huzooka: Hard-coded uri string in WorkflowListBuilder breaks if Drupal is installed in (webroot) subfolder

(cherry picked from commit 49b03d99)
parent cf2a659a
No related branches found
No related tags found
9 merge requests!1445Issue #2920039: Views' User Name exposed group filter validation,!1298Issue #3240993: Let layout builder render inline block translations,!774Issue #3174569: Example node template file name is incorrect,!497Issue #2463967: Use .user.ini file for PHP settings,!433Resolve #3163663 "Too many open files",!233Resolve #2693787 "Taxonomy term name",!133Resolve #2666286 "Clean up menuui",!112Resolve #3187004 "Drupaldatetime serialization issue",!53Resolve #3181870: Correct typo "the the" in "core/classList" deprecation message.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Url;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -93,7 +94,7 @@ public function render() { ...@@ -93,7 +94,7 @@ public function render() {
$build = parent::render(); $build = parent::render();
$workflow_types_count = count($this->workflowTypeManager->getDefinitions()); $workflow_types_count = count($this->workflowTypeManager->getDefinitions());
if ($workflow_types_count === 0) { if ($workflow_types_count === 0) {
$build['table']['#empty'] = $this->t('There are no workflow types available. In order to create workflows you need to install a module that provides a workflow type. For example, the <a href=":content-moderation">Content Moderation</a> module provides a workflow type that enables workflows for content entities.', [':content-moderation' => '/admin/modules#module-content-moderation']); $build['table']['#empty'] = $this->t('There are no workflow types available. In order to create workflows you need to install a module that provides a workflow type. For example, the <a href=":content-moderation">Content Moderation</a> module provides a workflow type that enables workflows for content entities.', [':content-moderation' => Url::fromRoute('system.modules_list', [], ['fragment' => 'module-content-moderation'])->toString()]);
} }
return $build; return $build;
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace Drupal\Tests\workflows\Functional; namespace Drupal\Tests\workflows\Functional;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase; use Drupal\Tests\BrowserTestBase;
/** /**
...@@ -46,6 +47,16 @@ public function testWorkflowUiWithNoType() { ...@@ -46,6 +47,16 @@ public function testWorkflowUiWithNoType() {
$this->assertSession()->linkExists('Content Moderation'); $this->assertSession()->linkExists('Content Moderation');
$this->assertSession()->pageTextNotContains('Add workflow'); $this->assertSession()->pageTextNotContains('Add workflow');
$this->clickLink('Content Moderation');
$modules_list_url_absolute = Url::fromRoute('system.modules_list', [], [
'fragment' => 'module-content-moderation',
'absolute' => TRUE,
])->toString();
$this->assertSame($this->getSession()->getCurrentUrl(), $modules_list_url_absolute);
// The current user does not have the 'administer modules' permission.
$this->assertSession()->statusCodeEquals(403);
$this->container->get('module_installer')->install(['workflow_type_test']); $this->container->get('module_installer')->install(['workflow_type_test']);
// The render cache needs to be cleared because although the cache tags are // The render cache needs to be cleared because although the cache tags are
// correctly set the render cache does not pick it up. // correctly set the render cache does not pick it up.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment