Skip to content
Snippets Groups Projects
Commit 6f4affd1 authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment