commit 27b6e6fe76024333a1d137c21b0c20cc121b490d Author: Andrei Mateescu Date: Mon Apr 1 21:07:35 2013 +0200 Fixed some small review points from #52. diff --git a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php index 081c191..c9448b4 100644 --- a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php @@ -64,11 +64,10 @@ function setUp() { ); field_create_instance($this->instance); - $this->form_display_options = array( - 'type' => 'datetime_default', - ); entity_get_form_display($this->instance['entity_type'], $this->instance['bundle'], 'default') - ->setComponent($this->field['field_name'], $this->form_display_options) + ->setComponent($this->field['field_name'], array( + 'type' => 'datetime_default', + )) ->save(); $this->display_options = array( @@ -223,16 +222,15 @@ function testDatelistWidget() { field_update_field($this->field); // Change the widget to a datelist widget. - $this->form_display_options = array( - 'type' => 'datetime_datelist', - 'settings' => array( - 'increment' => 1, - 'date_order' => 'YMD', - 'time_type' => '12', - ), - ); entity_get_form_display($this->instance['entity_type'], $this->instance['bundle'], 'default') - ->setComponent($this->instance['field_name'], $this->form_display_options) + ->setComponent($this->instance['field_name'], array( + 'type' => 'datetime_datelist', + 'settings' => array( + 'increment' => 1, + 'date_order' => 'YMD', + 'time_type' => '12', + ), + )) ->save(); field_cache_clear(); diff --git a/core/modules/entity/lib/Drupal/entity/Tests/EntityFormDisplayTest.php b/core/modules/entity/lib/Drupal/entity/Tests/EntityFormDisplayTest.php index 9d8accb..ddf709c 100644 --- a/core/modules/entity/lib/Drupal/entity/Tests/EntityFormDisplayTest.php +++ b/core/modules/entity/lib/Drupal/entity/Tests/EntityFormDisplayTest.php @@ -51,7 +51,7 @@ public function testEntityGetFromDisplay() { } /** - * Tests the behavior of a field component within an EntityDisplay object. + * Tests the behavior of a field component within an EntityFormDisplay object. */ public function testFieldComponent() { $this->enableModules(array('field_sql_storage', 'field_test')); diff --git a/core/modules/field/lib/Drupal/field/Plugin/field/widget/LegacyWidget.php b/core/modules/field/lib/Drupal/field/Plugin/field/widget/LegacyWidget.php index a03cb5e..3db5715 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/field/widget/LegacyWidget.php +++ b/core/modules/field/lib/Drupal/field/Plugin/field/widget/LegacyWidget.php @@ -47,9 +47,8 @@ public function formElement(array $items, $delta, array $element, $langcode, arr $function = $definition['module'] . '_field_widget_form'; if (function_exists($function)) { - // hook_field_widget_form() implementations read widget properties directly - // from $instance. Put the actual properties we use here, which might have - // been altered by hook_field_widget_property(). + // hook_field_widget_form() implementations read widget properties + // directly from $instance. $instance = clone $this->instance; $instance['widget']['type'] = $this->getPluginId(); $instance['widget']['settings'] = $this->getSettings();