diff --git a/admin/edit_post.php b/admin/edit_post.php
index a3b7b202..779c8400 100644
--- a/admin/edit_post.php
+++ b/admin/edit_post.php
@@ -31,6 +31,7 @@
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
define('WYSIWYG', 1);
+define('VALIDATOR', 1);
/* Get all the required files and functions */
require(HESK_PATH . 'hesk_settings.inc.php');
@@ -149,12 +150,20 @@ if (isset($_POST['save'])) {
// Custom fields
foreach ($hesk_settings['custom_fields'] as $k=>$v) {
if ($v['use'] && hesk_is_custom_field_in_category($k, $ticket['category'])) {
+ if ($v['req'] == 2) {
+ $v['req'] = '*';
+ $required_attribute = 'data-error="' . $hesklang['this_field_is_required'] . '" required';
+ } else {
+ $v['req'] = '';
+ $required_attribute = '';
+ }
+
if ($v['type'] == 'checkbox') {
$tmpvar[$k]='';
if (isset($_POST[$k]) && is_array($_POST[$k])) {
foreach ($_POST[$k] as $myCB) {
- $tmpvar[$k] .= ( is_array($myCB) ? '' : hesk_input($myCB) ) . '
';;
+ $tmpvar[$k] .= ( is_array($myCB) ? '' : hesk_input($myCB) ) . '
';
}
$tmpvar[$k]=substr($tmpvar[$k],0,-6);
} else {
@@ -280,14 +289,21 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');