Commit 9afeeb28 authored by alexpott's avatar alexpott

Issue #2110779 by larowlan: Fixed Fatal error: Cannot use object of type...

Issue #2110779 by larowlan: Fixed Fatal error: Cannot use object of type Drupal\field\Entity\FieldInstance as array in Drupal/field_ui()/Form/FieldInstanceEditForm.
parent 92fdd31e
......@@ -202,7 +202,7 @@ public function delete(array &$form, array &$form_state) {
$destination = drupal_get_destination();
$request->query->remove('destination');
}
$form_state['redirect'] = array('admin/structure/types/manage/' . $this->instance['bundle'] . '/fields/' . $this->instance->id() . '/delete', array('query' => $destination));
$form_state['redirect'] = array('admin/structure/types/manage/' . $this->instance->bundle . '/fields/' . $this->instance->id() . '/delete', array('query' => $destination));
}
/**
......
......@@ -74,6 +74,7 @@ function testCRUDFields() {
$this->addExistingField();
$this->cardinalitySettings();
$this->fieldListAdminPage();
$this->deleteFieldInstance();
}
/**
......@@ -208,6 +209,17 @@ function cardinalitySettings() {
$this->assertFieldByXPath("//input[@name='field[cardinality_number]']", 1);
}
/**
* Tests deleting a field from the instance edit form.
*/
protected function deleteFieldInstance() {
// Delete the field instance.
$instance_id = 'node.' . $this->type . '.' . $this->field_name;
$this->drupalGet('admin/structure/types/manage/' . $this->type . '/fields/' . $instance_id);
$this->drupalPostForm(NULL, array(), t('Delete field'));
$this->assertResponse(200);
}
/**
* Asserts field settings are as expected.
*
......
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