Commit 6f4affd1 authored by alexpott's avatar alexpott

Issue #2865223 by timmillwood, amateescu: Node type form alter sets new...

Issue #2865223 by timmillwood, amateescu: Node type form alter sets new revision to false on subsequent saves
parent ef21b947
......@@ -54,7 +54,7 @@ public function enforceRevisionsEntityFormAlter(array &$form, FormStateInterface
*/
public function enforceRevisionsBundleFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
// Force the revision checkbox on.
$form['workflow']['options']['#default_value']['revision'] = 'revision';
$form['workflow']['options']['#value']['revision'] = 'revision';
$form['workflow']['options']['revision']['#disabled'] = TRUE;
}
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\content_moderation\Functional;
use Drupal\Core\Session\AccountInterface;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;
......@@ -110,6 +111,9 @@ protected function createContentTypeFromUi($content_type_name, $content_type_id,
];
$this->drupalPostForm(NULL, $edit, t('Save content type'));
// Check the content type has been set to create new revisions.
$this->assertTrue(NodeType::load($content_type_id)->isNewRevision());
if ($moderated) {
$this->enableModerationThroughUi($content_type_id, $workflow_id);
}
......
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