Commit a790ff2e authored by alexpott's avatar alexpott

Issue #2630162 by felribeiro, pguillard, pingwin4eg, karsumit94: The Edit URL...

Issue #2630162 by felribeiro, pguillard, pingwin4eg, karsumit94: The Edit URL Alias form buttons should be styled in consistency with other buttons
parent 53b7b924
......@@ -40,28 +40,25 @@ public function buildForm(array $form, FormStateInterface $form_state, $pid = NU
'#type' => 'hidden',
'#value' => $this->path['pid'],
);
$form['actions']['delete'] = array(
'#type' => 'submit',
'#value' => $this->t('Delete'),
'#submit' => array('::deleteSubmit'),
);
return $form;
}
/**
* Submits the delete form.
*/
public function deleteSubmit(array &$form, FormStateInterface $form_state) {
$url = new Url('path.delete', array(
'pid' => $form_state->getValue('pid'),
'pid' => $this->path['pid'],
));
if ($this->getRequest()->query->has('destination')) {
$url->setOption('query', $this->getDestinationArray());
$this->getRequest()->query->remove('destination');
}
$form_state->setRedirectUrl($url);
$form['actions']['delete'] = array(
'#type' => 'link',
'#title' => $this->t('Delete'),
'#url' => $url,
'#attributes' => array(
'class' => array('button', 'button--danger'),
),
);
return $form;
}
}
......@@ -151,6 +151,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $pid = NU
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $this->t('Save'),
'#button_type' => 'primary',
);
return $form;
......
......@@ -145,7 +145,9 @@ function testAdminAlias() {
]), 'Attempt to move upper-case alias was rejected.');
// Delete alias.
$this->drupalPostForm('admin/config/search/path/edit/' . $pid, array(), t('Delete'));
$this->drupalGet('admin/config/search/path/edit/' . $pid);
$this->clickLink(t('Delete'));
$this->assertRaw(t('Are you sure you want to delete path alias %name?', array('%name' => $edit['alias'])));
$this->drupalPostForm(NULL, array(), t('Confirm'));
// Confirm that the alias no longer works.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment