diff --git a/core/profiles/demo_umami/config/optional/block.block.umami_footer_promo.yml b/core/profiles/demo_umami/config/optional/block.block.umami_footer_promo.yml index 338621885d..a85ebdb98d 100644 --- a/core/profiles/demo_umami/config/optional/block.block.umami_footer_promo.yml +++ b/core/profiles/demo_umami/config/optional/block.block.umami_footer_promo.yml @@ -18,6 +18,6 @@ settings: label_display: '0' promo_title: 'Umami Food Magazine' promo_text: 'Skills and know-how. Magazine exclusive articles, recipes and plenty of reasons to get your copy today.' - findmore_url: 'https://www.drupal.org' + findmore_url: '/about-umami' findmore_text: 'Find out more' visibility: { } diff --git a/core/profiles/demo_umami/src/Plugin/Block/UmamiFooterPromo.php b/core/profiles/demo_umami/src/Plugin/Block/UmamiFooterPromo.php index d00e4e8c45..8ae90dccde 100644 --- a/core/profiles/demo_umami/src/Plugin/Block/UmamiFooterPromo.php +++ b/core/profiles/demo_umami/src/Plugin/Block/UmamiFooterPromo.php @@ -4,6 +4,7 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Render\Element\PathElement; /** * Provides a 'Promo banner' block for footer. @@ -71,10 +72,12 @@ public function blockForm($form, FormStateInterface $form_state) { ]; $form['findmore']['url'] = [ - '#type' => 'url', + '#type' => 'path', + '#convert_path' => PathElement::CONVERT_NONE, + '#validate_path' => FALSE, '#title' => $this->t('URL'), '#default_value' => $this->configuration['findmore_url'], - '#description' => $this->t('Enter an absolute url. Eg: https://www.drupal.org'), + '#description' => $this->t('Enter an relative or absolute url. Eg: /about-umami or https://www.drupal.org'), ]; $form['findmore']['text'] = [ diff --git a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php index 2bc976d80c..a9380d6a9e 100644 --- a/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php +++ b/core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php @@ -100,9 +100,11 @@ public function testEditNodesByAdmin() { $webassert = $this->assertSession(); // Check that admin is able to edit the node. - $nodes = entity_load_multiple_by_properties('node', ['title' => 'Deep mediterranean quiche']); + $nodes = $this->container->get('entity_type.manager') + ->getStorage('node') + ->loadByProperties(['title' => 'Deep mediterranean quiche']); $node = reset($nodes); - $this->drupalGet('node/' . $node->id() . '/edit'); + $this->drupalGet($node->toUrl('edit-form')); $webassert->statusCodeEquals('200'); $this->submitForm([], "Save"); $webassert->pageTextContains('Recipe Deep mediterranean quiche has been updated.');