From f97e08d418dae15b8a180b7bd0840b35b4b08f77 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:57:13 -0700 Subject: [PATCH] Email Template Edit: Fix enabled default value (#7546) --- core/email_templates/email_template_edit.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/email_templates/email_template_edit.php b/core/email_templates/email_template_edit.php index b3f04cc2ee..277462a91f 100644 --- a/core/email_templates/email_template_edit.php +++ b/core/email_templates/email_template_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2018-2023 + Portions created by the Initial Developer are Copyright (C) 2018-2025 the Initial Developer. All Rights Reserved. */ @@ -54,7 +54,6 @@ $template_subject = ''; $template_body = ''; $template_type = ''; - $template_enabled = false; $template_description = ''; //get http post variables and set them to php variables @@ -66,7 +65,7 @@ $template_subject = $_POST["template_subject"]; $template_body = $_POST["template_body"]; $template_type = $_POST["template_type"]; - $template_enabled = $_POST["template_enabled"] ?? false; + $template_enabled = $_POST["template_enabled"]; $template_description = $_POST["template_description"]; } @@ -189,6 +188,9 @@ $setting_indenting = isset($_SESSION['editor']['indent_guides']['text']) ? $_SESSION['editor']['indent_guides']["text"]: 'false'; $setting_numbering = isset($_SESSION['editor']['line_numbers']['text']) ? $_SESSION['editor']['line_numbers']["text"] : 'true'; +//set the defaults + if ($template_enabled === null) { $template_enabled = true; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']);