diff --git a/src/Form/UwContentModerationForm.php b/src/Form/UwContentModerationForm.php index 9b398b70bf8e77d7b8030f76584bd39f1c2f6ca3..e1c03a08b4c77627d9eff8c4d3fbc06f64a3d15c 100644 --- a/src/Form/UwContentModerationForm.php +++ b/src/Form/UwContentModerationForm.php @@ -104,7 +104,7 @@ class UwContentModerationForm extends ConfirmFormBase { $node = $this->entityTypeManager->getStorage('node')->load($this->nid); // Return the question to see if they want to publish the node. - return t('Are you sure you want to unpublish %node_title?', ['%node_title' => $node->getTitle()]); + return $this->t('Are you sure you want to unpublish %node_title?', ['%node_title' => $node->getTitle()]); } /** diff --git a/uw_cfg_common.module b/uw_cfg_common.module index 10a21fb1b79a0e0450a62fd3d4b8c45582103ff8..45770f0d0b29e68ce5d7818c5bcb496c3cc14072 100644 --- a/uw_cfg_common.module +++ b/uw_cfg_common.module @@ -211,3 +211,13 @@ function uw_cfg_common_preprocess_node(&$variables) { $variables['uw_content_moderation_form'] = $render; } } + +/** + * Implements hook_form_FORM_ID_alter(). + * + * Set the default of preview mode disabled. + */ +function uw_cfg_common_form_node_type_add_form_alter(&$form, FormStateInterface $form_state, $form_id) { + $form['submission']['preview_mode']['#default_value'] = 0; + +}