diff --git a/core/modules/node/node.module b/core/modules/node/node.module index b7ecaef..9ec8a18 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -211,18 +211,6 @@ function node_entity_view_display_alter(EntityViewDisplayInterface $display, $co } /** -<<<<<<< HEAD - * Implements hook_entity_form_display_alter(). - */ -function node_entity_form_display_alter(EntityFormDisplayInterface $form_display, $context) { - if ($context['entity_type'] == 'node') { - $node_type = node_type_load($context['bundle']); - } -} - -/** -======= ->>>>>>> applied patch * Entity URI callback. * * @param \Drupal\node\NodeInterface $node diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index 00baf45..a3986ab 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -454,15 +454,9 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setQueryable(FALSE) ->setRevisionable(TRUE); -<<<<<<< HEAD $fields['revision_log'] = FieldDefinition::create('string_long') ->setLabel(t('Revision log message')) - ->setDescription(t('The log entry explaining the changes in this revision.')) -======= - $fields['log'] = FieldDefinition::create('string_long') - ->setLabel(t('Revision log message')) ->setDescription(t('Briefly describe the changes you have made.')) ->>>>>>> applied patch ->setRevisionable(TRUE) ->setTranslatable(TRUE) ->setDisplayOptions('form', array( diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 59898bc..85b5de0 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -7,17 +7,13 @@ namespace Drupal\node; -<<<<<<< HEAD use Drupal\Component\Utility\NestedArray; use Drupal\Core\Datetime\DrupalDateTime; use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Language\LanguageInterface; use Drupal\Component\Utility\String; -======= use Drupal\Core\Cache\Cache; -use Drupal\Core\Entity\ContentEntityForm; use Drupal\Core\Language\Language; ->>>>>>> applied patch /** * Form controller for the node edit forms. @@ -42,14 +38,8 @@ protected function prepareEntity() { $this->settings = $type->getModuleSettings('node'); if (!$node->isNew()) { -<<<<<<< HEAD - $node->date = format_date($node->getCreatedTime(), 'custom', 'Y-m-d H:i:s O'); - // Remove the revision log message from the original node entity. - $node->revision_log = NULL; -======= // Remove the log message from the original node entity. - $node->log = NULL; ->>>>>>> applied patch + $node->revision_log = NULL; } } @@ -105,19 +95,8 @@ public function form(array $form, array &$form_state) { '#access' => isset($language_configuration['language_show']) && $language_configuration['language_show'], ); -<<<<<<< HEAD - $form['advanced'] = array( - '#type' => 'vertical_tabs', - '#attributes' => array('class' => array('entity-meta')), - '#weight' => 99, - ); - - // Add a revision log field if the "Create new revision" option is checked, - // or if the current user has the ability to check that option. -======= - // Add a log field if the "Create new revision" option is checked, or if + // Add a revision_log field if the "Create new revision" option is checked, or if // the current user has the ability to check that option. ->>>>>>> applied patch $form['revision_information'] = array( '#type' => 'details', '#group' => 'advanced', @@ -145,16 +124,7 @@ public function form(array $form, array &$form_state) { '#weight' => -1, ); -<<<<<<< HEAD - $form['revision_log'] = array( - '#type' => 'textarea', - '#title' => t('Revision log message'), - '#rows' => 4, - '#default_value' => !empty($node->revision_log->value) ? $node->revision_log->value : '', - '#description' => t('Briefly describe the changes you have made.'), -======= - $form['log'] += array( ->>>>>>> applied patch + $form['revision_log'] += array( '#states' => array( 'visible' => array( ':input[name="revision"]' => array('checked' => TRUE), @@ -316,24 +286,6 @@ public function validate(array $form, array &$form_state) { $this->setFormError('changed', $form_state, $this->t('The content on this page has either been modified by another user, or you have already submitted modifications using this form. As a result, your changes cannot be saved.')); } -<<<<<<< HEAD - // Validate the "authored by" field. - if (!empty($form_state['values']['uid']) && !user_load_by_name($form_state['values']['uid'])) { - // The use of empty() is mandatory in the context of usernames - // as the empty string denotes the anonymous user. In case we - // are dealing with an anonymous user we set the user ID to 0. - $this->setFormError('uid', $form_state, $this->t('The username %name does not exist.', array('%name' => $form_state['values']['uid']))); - } - - // Validate the "authored on" field. - // The date element contains the date object. - $date = $node->date instanceof DrupalDateTime ? $node->date : new DrupalDateTime($node->date); - if ($date->hasErrors()) { - $this->setFormError('date', $form_state, $this->t('You have to specify a valid date.')); - } - -======= ->>>>>>> applied patch // Invoke hook_node_validate() for validation needed by modules. // Can't use \Drupal::moduleHandler()->invokeAll(), because $form_state must // be receivable by reference. diff --git a/core/modules/node/src/Tests/PagePreviewTest.php b/core/modules/node/src/Tests/PagePreviewTest.php index 6f02b4e..4578352 100644 --- a/core/modules/node/src/Tests/PagePreviewTest.php +++ b/core/modules/node/src/Tests/PagePreviewTest.php @@ -192,11 +192,7 @@ function testPagePreviewWithRevisions() { $edit[$title_key] = $this->randomName(8); $edit[$body_key] = $this->randomName(16); $edit[$term_key] = $this->term->id(); -<<<<<<< HEAD - $edit['revision_log'] = $this->randomName(32); -======= - $edit['log[0][value]'] = $this->randomName(32); ->>>>>>> applied patch + $edit['revision_log[0][value]'] = $this->randomName(32); $this->drupalPostForm('node/add/page', $edit, t('Preview')); // Check that the preview is displaying the title, body and term. @@ -210,13 +206,8 @@ function testPagePreviewWithRevisions() { $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.'); $this->assertFieldByName($term_key, $edit[$term_key], 'Term field displayed.'); -<<<<<<< HEAD - // Check that the revision log field has the correct value. - $this->assertFieldByName('revision_log', $edit['revision_log'], 'Revision log field displayed.'); -======= // Check that the log field has the correct value. - $this->assertFieldByName('log[0][value]', $edit['log[0][value]'], 'Log field displayed.'); ->>>>>>> applied patch + $this->assertFieldByName('revision_log[0][value]', $edit['log[0][value]'], 'Revision Log field displayed.'); } } diff --git a/core/modules/node/templates/node.html.twig b/core/modules/node/templates/node.html.twig index ca9a0f4..a0e629e 100644 --- a/core/modules/node/templates/node.html.twig +++ b/core/modules/node/templates/node.html.twig @@ -20,22 +20,12 @@ * or print a subset such as {{ content.field_example }}. Use * {{ content|without('field_example') %} to temporarily suppress the printing * of a given child element. -<<<<<<< HEAD * - author_picture: The node author user entity, rendered using the "compact" * view mode. * - metadata: Metadata for this node. - * - date: Formatted creation date. Preprocess functions can reformat it by - * calling format_date() with the desired parameters on - * $variables['created']. - * - author_name: Themed username of node author output from theme_username(). - * - url: Direct URL of the current node. -======= - * - user_picture: The node author's information as loaded from the 'compact' - * view mode for the user entity. * - date: Themed creation date field. - * - name: Themed author date field. - * - node_url: Direct URL of the current node. ->>>>>>> applied patch + * - author_name: Themed author name field. + * - url: Direct URL of the current node. * - display_submitted: Whether submission information should be displayed. * - attributes: HTML attributes for the containing element. * The attributes.class element may contain one or more of the following