Issue #1359710 by pwolanin, xjm: Fixed taxonomy_menu() passes invalid arguments into taxonomy_form_term().

8.0.x
catch 2011-12-30 16:02:33 +09:00
parent 06373cfba5
commit 6630a4eb5f
2 changed files with 7 additions and 1 deletions

View File

@ -310,7 +310,9 @@ function taxonomy_menu() {
$items['taxonomy/term/%taxonomy_term/edit'] = array(
'title' => 'Edit',
'page callback' => 'drupal_get_form',
'page arguments' => array('taxonomy_form_term', 2),
// Pass a NULL argument to ensure that additional path components are not
// passed to taxonomy_form_term() as the vocabulary machine name argument.
'page arguments' => array('taxonomy_form_term', 2, NULL),
'access callback' => 'taxonomy_term_edit_access',
'access arguments' => array(2),
'type' => MENU_LOCAL_TASK,

View File

@ -703,6 +703,10 @@ class TaxonomyTermTestCase extends TaxonomyWebTestCase {
// Check that the term feed page is working.
$this->drupalGet('taxonomy/term/' . $term->tid . '/feed');
// Check that the term edit page does not try to interpret additional path
// components as arguments for taxonomy_form_term().
$this->drupalGet('taxonomy/term/' . $term->tid . '/edit/' . $this->randomName());
// Delete the term.
$this->drupalPost('taxonomy/term/' . $term->tid . '/edit', array(), t('Delete'));
$this->drupalPost(NULL, NULL, t('Delete'));