issue: Client-Side Reply Draft Saving

This addresses an issue where Draft saving for the Post a Reply box on the
Client Portal returns the error `Draft body not found in request`. This is
due to using the generic name of `message` instead of the hashed Form name.
This updates the code to set the hashed Form name using
`$messageField->getFormName()`.
This commit is contained in:
JediKev
2021-01-07 19:39:53 +00:00
parent 7234a1f7ad
commit 996cd9ea7a
2 changed files with 2 additions and 2 deletions

View File

@@ -173,7 +173,7 @@ if ((!$ticket->isClosed() || $ticket->isReopenable()) && !$blockReply) { ?>
echo __('To best assist you, we request that you be specific and detailed'); ?></em>
<font class="error">*&nbsp;<?php echo $errors['message']; ?></font>
</p>
<textarea name="message" id="message" cols="50" rows="9" wrap="soft"
<textarea name="<?php echo $messageField->getFormName(); ?>" id="message" cols="50" rows="9" wrap="soft"
class="<?php if ($cfg->isRichTextEnabled()) echo 'richtext';
?> draft" <?php
list($draft, $attrs) = Draft::getDraftAndDataAttrs('ticket.client', $ticket->getId(), $info['message']);

View File

@@ -76,7 +76,7 @@ if ($_POST && is_object($ticket) && $ticket->getId()) {
if(!$ticket->checkUserAccess($thisclient)) //double check perm again!
$errors['err']=__('Access Denied. Possibly invalid ticket ID');
$_POST['message'] = ThreadEntryBody::clean($_POST['message']);
$_POST['message'] = ThreadEntryBody::clean($_POST[$messageField->getFormName()]);
if (!$_POST['message'])
$errors['message'] = __('Message required');