Commit 7a52a88b authored by alexpott's avatar alexpott

Issue #2399307 by larowlan, SteffenR:...

Issue #2399307 by larowlan, SteffenR: comment_form_field_ui_field_storage_edit_form_alter() no longer working
parent 6df284ec
......@@ -351,8 +351,8 @@ function comment_form_field_ui_field_storage_edit_form_alter(&$form, FormStateIn
if ($form['#field']->getType() == 'comment') {
// We only support posting one comment at the time so it doesn't make sense
// to let the site builder choose anything else.
$form['field']['cardinality_container']['cardinality']['#options'] = array(1 => 1);
$form['field']['cardinality_container']['#access'] = FALSE;
$form['field_storage']['cardinality_container']['cardinality']['#default_value'] = 1;
$form['field_storage']['cardinality_container']['#access'] = FALSE;
}
}
......
......@@ -244,8 +244,14 @@ function testCommentFunctionality() {
$this->assertText(t('Comments'));
$this->assertLinkByHref('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
// Test widget hidden option is not visible when there's no comments.
$this->drupalGet('entity_test/structure/entity_test/entity-test/fields/entity_test.entity_test.comment');
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment');
$this->assertResponse(200);
$this->assertNoField('edit-default-value-input-comment-und-0-status-0');
// Test that field to change cardinality is not available.
$this->drupalGet('entity_test/structure/entity_test/fields/entity_test.entity_test.comment/storage');
$this->assertResponse(200);
$this->assertNoField('field_storage[cardinality_number]');
$this->assertNoField('field_storage[cardinality]');
$this->drupalLogin($this->adminUser);
......@@ -382,6 +388,7 @@ function testCommentFunctionality() {
$field_storage = entity_load('field_storage_config', 'entity_test.field_barfoo');
$this->assertTrue($field_storage);
$this->assertEqual($field_storage->getSetting('comment_type'), 'foobar');
$this->assertEqual($field_storage->getCardinality(), 1);
// Test the new entity commenting inherits default.
$random_label = $this->randomMachineName();
......
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