diff --git a/project_issue.module b/project_issue.module index b1a5e8f..4052f1d 100644 --- a/project_issue.module +++ b/project_issue.module @@ -176,14 +176,15 @@ function project_issue_menu() { /** * Implementation of hook_menu_alter(). + * + * A project_issue node requires a parent project, and also that a "component" + * of that project is specified. In order to have the pull-down for the + * component be properly populated, we hook 'node/add/project-issue' and + * have the user select a project there, and then a form on + * 'node/add/project-issue/' has the component widget properly + * constructed. */ function project_issue_menu_alter(&$items) { - // A project_issue node requires a parent project, and also that a "component" - // of that project is specified. In order to have the pull-down for the - // component be properly populated, we hook 'node/add/project-issue' and - // have the user select a project there, and then a form on - // 'node/add/project-issue/' has the component widget properly - // constructed. foreach (project_issue_issue_node_types() as $issue_type) { $type_url_str = str_replace('_', '-', $issue_type); $items['node/add/' . $type_url_str]['page callback'] = 'drupal_get_form'; @@ -194,8 +195,8 @@ function project_issue_menu_alter(&$items) { // Override the taxonomy autocomplete route for any taxonomy term fields // with the naming scheme "taxonomy_vocabulary_[vid]" where the vocabulary - //they reference has project issue enabled. This allows us to override the sorting - // for the data returned. + // they reference has project issue enabled. This allows us to override the + // sorting for the data returned. foreach (taxonomy_get_vocabularies() as $vid => $vocabulary) { if (variable_get('project_issue_taxonomy_vocabulary_issue_queue_' . $vid, 0) === 'autocomplete') { $items['taxonomy/autocomplete/taxonomy_vocabulary_' . $vid] = array( diff --git a/tests/integration/issue_autocomplete.test b/tests/integration/issue_autocomplete.test index 75c3f74..8d70181 100644 --- a/tests/integration/issue_autocomplete.test +++ b/tests/integration/issue_autocomplete.test @@ -32,11 +32,12 @@ class ProjectIssueAutocompleteTestCase extends DrupalWebTestCase { taxonomy_vocabulary_save($vocabulary); $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary->machine_name); - // Enable this vocab for the issue queue, and have it use an autocomplete widget. + // Enable this vocab for the issue queue, and have it use an autocomplete + // widget. variable_set('project_issue_taxonomy_vocabulary_issue_queue_' . $vocabulary->vid, 'autocomplete'); - // Rebuild menu router table so that the menu_alter hook can insert the proper - // autocomplete route override for the vocab we just added. + // Rebuild menu router table so that the menu_alter hook can insert the + // proper autocomplete route override for the vocab we just added. menu_rebuild(); $termA = new stdClass(); @@ -78,7 +79,8 @@ class ProjectIssueAutocompleteTestCase extends DrupalWebTestCase { ); field_create_instance($instance); - // Create nodes in such a way that the usage of TermC is heaviest and TermA the lightest. + // Create nodes in such a way that the usage of TermC is heaviest and TermA + // the lightest. $this->drupalCreateNode(array( 'type' => 'article', 'taxonomy_vocabulary_' . $vocabulary->vid => array( @@ -107,8 +109,8 @@ class ProjectIssueAutocompleteTestCase extends DrupalWebTestCase { ), )); - // The order of the terms returned should be based on usage of each term, with - // highest usage listed first. + // The order of the terms returned should be based on usage of each term, + // with highest usage listed first. $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_' . $vocabulary->vid . '/test'); $expected = '{"testC":"testC","testB":"testB","testA":"testA"}'; $this->assertEqual($results, $expected); @@ -116,8 +118,8 @@ class ProjectIssueAutocompleteTestCase extends DrupalWebTestCase { $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_foo'); $this->assertEqual($results, 'Taxonomy field taxonomy_vocabulary_foo not found.'); - // Make sure that original sorting (seems to be alphabetical) still works when we no longer use - // this vocabulary for project issue. + // Make sure that original sorting (seems to be alphabetical) still works + // when we no longer use this vocabulary for project issue. variable_del('project_issue_taxonomy_vocabulary_issue_queue_' . $vocabulary->vid); menu_rebuild(); $results = $this->drupalGet('taxonomy/autocomplete/taxonomy_vocabulary_' . $vocabulary->vid . '/test');