diff --git a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeTimestampWidget.php b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeTimestampWidget.php index 6c50058..828a7c5 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeTimestampWidget.php +++ b/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeTimestampWidget.php @@ -9,6 +9,7 @@ use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\WidgetBase; +use Drupal\Core\Form\FormStateInterface; /** * Plugin implementation of the 'datetime timestamp' widget. @@ -27,7 +28,7 @@ class DateTimeTimestampWidget extends WidgetBase { /** * {@inheritdoc} */ - public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) { + public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $date_format = entity_load('date_format', 'html_date')->getPattern(); $time_format = entity_load('date_format', 'html_time')->getPattern(); $default_value = isset($items[$delta]->value) ? DrupalDateTime::createFromTimestamp($items[$delta]->value) : ''; diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 23b45b1..b96bf53 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -7,6 +7,7 @@ namespace Drupal\node; +use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageInterface; @@ -385,6 +386,8 @@ public function unpublish(array $form, FormStateInterface $form_state) { } /** + * {@inheritdoc} + */ public function buildEntity(array $form, FormStateInterface $form_state) { /** @var \Drupal\node\NodeInterface $entity */ $entity = parent::buildEntity($form, $form_state); diff --git a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php index a2a181d..bbba4e9 100644 --- a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php +++ b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php @@ -61,8 +61,8 @@ function testMultiStepNodeFormBasicOptions() { "{$this->field_name}[0][value]" => $this->randomString(32), ); $this->drupalPostForm('node/add/page', $edit, t('Add another item')); - $this->assertNoFieldChecked('edit-promote-value', 'promote stayed unchecked'); - $this->assertFieldChecked('edit-sticky-value', 'sticky stayed checked'); + $this->assertNoFieldChecked('edit-promote-value', 'Promote stayed unchecked'); + $this->assertFieldChecked('edit-sticky-value', 'Sticky stayed checked'); } } diff --git a/core/modules/node/src/Tests/PageEditTest.php b/core/modules/node/src/Tests/PageEditTest.php index 9147296..f87e7dd 100644 --- a/core/modules/node/src/Tests/PageEditTest.php +++ b/core/modules/node/src/Tests/PageEditTest.php @@ -7,8 +7,6 @@ namespace Drupal\node\Tests; -use Drupal\Component\Utility\String; - /** * Create a node and test node edit functionality. * diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 9abf2e6..95797f9 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -305,7 +305,7 @@ function rdf_preprocess_node(&$variables) { // Adds RDFa markup for the date. $created_mapping = $mapping->getPreparedFieldMapping('created'); if (!empty($created_mapping) && $variables['display_submitted']) { - $date_attributes = rdf_rdfa_attributes($created_mapping, $variables['node']->get('created')[0]->getValue()); + $date_attributes = rdf_rdfa_attributes($created_mapping, $variables['node']->get('created')->first()->getValue()); $rdf_metadata = array( '#theme' => 'rdf_metadata', '#metadata' => array($date_attributes),