diff --git a/src/Entity/JobItem.php b/src/Entity/JobItem.php index 3ea8047..09149b4 100644 --- a/src/Entity/JobItem.php +++ b/src/Entity/JobItem.php @@ -571,7 +571,7 @@ class JobItem extends ContentEntityBase implements JobItemInterface { } /** - * + * * @return boolean */ public function isAbortable() { diff --git a/src/Form/JobItemForm.php b/src/Form/JobItemForm.php index b48efa4..91ec8f0 100644 --- a/src/Form/JobItemForm.php +++ b/src/Form/JobItemForm.php @@ -32,7 +32,7 @@ class JobItemForm extends TmgmtFormBase { * @var \Drupal\tmgmt\JobItemInterface */ protected $entity; - + /** * Overrides Drupal\Core\Entity\EntityForm::form(). */ @@ -160,18 +160,18 @@ class JobItemForm extends TmgmtFormBase { $form['footer'] = tmgmt_color_review_legend(); return $form; } - + protected function actions(array $form, FormStateInterface $form_state) { $item = $this->entity; - + // Add the form actions as well. $actions['abort_job_item'] = array( '#type' => 'submit', - '#value' => t('Abort item'), - '#redirect' => 'admin/tmgmt/items/' .$item->id().'/abort', + '#value' => t('Abort Item'), + '#redirect' => 'admin/tmgmt/items/' . $item->id() . '/abort', '#submit' => array('tmgmt_submit_redirect'), '#access' => $item->isAbortable(), - '#weight' => 15, + '#weight' => 20, ); $actions['accept'] = array( '#type' => 'submit', diff --git a/src/Tests/TMGMTUiTest.php b/src/Tests/TMGMTUiTest.php index 5694e50..32b11e0 100644 --- a/src/Tests/TMGMTUiTest.php +++ b/src/Tests/TMGMTUiTest.php @@ -354,7 +354,8 @@ class TMGMTUiTest extends EntityTestBase { ))); $end_rows = $this->xpath('//tbody/tr'); $this->assertEqual(count($end_rows), 4); - $this->drupalPostForm('admin/tmgmt/items/1', NULL, t('Abort Item')); + $this->drupalPostForm('admin/tmgmt/items/' . $item4->id(), array(), t('Abort Item')); + $this->drupalPostForm(NULL, array(), t('Confirm')); } /** @@ -468,7 +469,7 @@ class TMGMTUiTest extends EntityTestBase { $this->assertText('test_source:test_suggestion_suggestion:7'); } - + /** * Test the process of aborting and resubmitting the job. */