Issue #2995200 by Sam152, sjancich: Defaults for publishing options do not save when workflow is enabled
parent
185513febe
commit
d0a2440cff
|
@ -54,7 +54,7 @@ class NodeModerationHandler extends ModerationHandler {
|
|||
*/
|
||||
public function enforceRevisionsBundleFormAlter(array &$form, FormStateInterface $form_state, $form_id) {
|
||||
// Force the revision checkbox on.
|
||||
$form['workflow']['options']['#value']['revision'] = 'revision';
|
||||
$form['workflow']['options']['revision']['#value'] = 'revision';
|
||||
$form['workflow']['options']['revision']['#disabled'] = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,4 +88,21 @@ class ModerationStateNodeTypeTest extends ModerationStateTestBase {
|
|||
$this->assertSession()->optionExists('moderation_state[0][state]', 'published');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \Drupal\content_moderation\Entity\Handler\NodeModerationHandler::enforceRevisionsBundleFormAlter
|
||||
*/
|
||||
public function testEnforceRevisionsEntityFormAlter() {
|
||||
$this->drupalLogin($this->adminUser);
|
||||
$this->createContentTypeFromUi('Moderated', 'moderated');
|
||||
|
||||
// Ensure checkboxes in the 'workflow' section can be altered, even when
|
||||
// 'revision' is enforced and disabled.
|
||||
$this->drupalGet('admin/structure/types/manage/moderated');
|
||||
$this->drupalPostForm('admin/structure/types/manage/moderated', [
|
||||
'options[promote]' => TRUE,
|
||||
], 'Save content type');
|
||||
$this->drupalGet('admin/structure/types/manage/moderated');
|
||||
$this->assertSession()->checkboxChecked('options[promote]');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue