commit 7b3d7906a1e45d2a1f94c547aa30fa905a7447cf Author: Lee Rowlands Date: Tue Oct 15 16:09:40 2013 +1000 patch 22 diff --git a/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php b/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php index 195e946..8793256 100644 --- a/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php +++ b/core/modules/edit/lib/Drupal/edit/Form/EditFieldForm.php @@ -120,7 +120,7 @@ protected function init(array &$form_state, EntityInterface $entity, $field_name if ($entity->entityType() == 'node') { $node_type_settings = $this->nodeTypeStorage->load($entity->bundle())->getModuleSettings('node'); $options = (isset($node_type_settings['options'])) ? $node_type_settings['options'] : array(); - $entity->setNewRevision(in_array('revision', $options)); + $entity->setNewRevision(!empty($options['revision']) ? $options['revision'] : 0); $entity->log = NULL; } diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php index a52faa0..73aaead 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php @@ -246,7 +246,10 @@ public function testUserWithPermission() { // then again retrieve the field form, fill it, submit it (so it ends up // in TempStore) and then save the entity. Now there should be two // revisions. - $this->container->get('config.factory')->get('node.type.article')->set('settings.node.options', array('status', 'revision'))->save(); + $this->container->get('config.factory')->get('node.type.article')->set('settings.node.options', array( + 'status' => TRUE, + 'revision' => TRUE, + ))->save(); // Retrieve field form. $post = array('nocssjs' => 'true', 'reset' => 'true'); diff --git a/core/modules/node/lib/Drupal/node/Entity/NodeType.php b/core/modules/node/lib/Drupal/node/Entity/NodeType.php index 75fb93d..350d687 100644 --- a/core/modules/node/lib/Drupal/node/Entity/NodeType.php +++ b/core/modules/node/lib/Drupal/node/Entity/NodeType.php @@ -225,6 +225,7 @@ public static function preCreate(EntityStorageControllerInterface $storage_contr 'options' => array( 'status' => TRUE, 'promote' => TRUE, + 'revision' => FALSE, ), 'preview' => DRUPAL_OPTIONAL, 'submitted' => TRUE,