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
92fdd31e3e
commit
9afeeb2893
|
@ -202,7 +202,7 @@ class FieldInstanceEditForm extends FormBase {
|
||||||
$destination = drupal_get_destination();
|
$destination = drupal_get_destination();
|
||||||
$request->query->remove('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 @@ class ManageFieldsTest extends FieldUiTestBase {
|
||||||
$this->addExistingField();
|
$this->addExistingField();
|
||||||
$this->cardinalitySettings();
|
$this->cardinalitySettings();
|
||||||
$this->fieldListAdminPage();
|
$this->fieldListAdminPage();
|
||||||
|
$this->deleteFieldInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -208,6 +209,17 @@ class ManageFieldsTest extends FieldUiTestBase {
|
||||||
$this->assertFieldByXPath("//input[@name='field[cardinality_number]']", 1);
|
$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.
|
* Asserts field settings are as expected.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue