Skip to content
Snippets Groups Projects
Commit 423eb3ad authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3469299: The page title "edit tour" is too generic

parent 77aded0a
No related branches found
No related tags found
1 merge request!44Issue #3469299: The page title "edit tour" is too generic
Pipeline #262873 passed
......@@ -47,6 +47,10 @@ class TourForm extends EntityForm {
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state): array {
if ($this->operation == 'edit') {
$form['#title'] = $this->t('Edit <em>%label</em> tour', ['%label' => $this->entity->label()]);
}
$tour = $this->entity;
$form = parent::form($form, $form_state);
$form['label'] = [
......
......@@ -88,8 +88,9 @@ class TourUITest extends BrowserTestBase {
*/
protected function editTest(): void {
// Create a new tour. Ensure that it comes before the test tours.
$label = 'a' . $this->randomString();
$edit = [
'label' => 'a' . $this->randomString(),
'label' => $label,
'id' => strtolower($this->randomMachineName()),
'module' => strtolower($this->randomMachineName()),
'routes' => '<front>',
......@@ -102,7 +103,7 @@ class TourUITest extends BrowserTestBase {
$this->assertEquals(1, count($elements));
// Edit and re-save an existing tour.
$this->assertSession()->titleEquals('Edit tour | Drupal');
$this->assertSession()->titleEquals('Edit ' . $label . ' tour | Drupal');
$this->submitForm([], 'Save');
$this->assertSession()->responseContains($this->t('The tour %tour has been updated.', ['%tour' => $edit['label']]));
......
......@@ -17,8 +17,7 @@ tour.tour.add:
entity.tour.edit_form:
path: '/admin/config/user-interface/tour/manage/{tour}'
defaults:
_entity_form: tour.default
_title: 'Edit tour'
_entity_form: 'tour.edit'
requirements:
_permission: 'administer tour'
......
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