Bug: approval-queue delete with reason >100 chars throws and leaves items stuck in the queue
Hi,
[XB] Approval Queue Improvements 2.1.3 Patch Level 3 on XenForo 2.2.11.
When a moderator deletes content from the approval queue with a reason longer than 100 characters, the action fails with "Please enter a value using 100 characters or fewer" and the item stays in the approval queue. The same failure then repeats on every job retry and blocks other queued actions in the same run, so moderators see batches where only some approvals/deletions register.
Stack trace (from the XF:ApprovalQueueProcess job):
#0 src/addons/PB/ApprovalQueueImprovements/XF/ApprovalQueue/Thread.php(67): XF\Mvc\Entity\Entity->save()
#1 src/addons/PB/ModerationNotifier/XF/ApprovalQueue/Thread.php(41): PB\ApprovalQueueImprovements\XF\ApprovalQueue\Thread->actionDelete(...)
#2 src/XF/ApprovalQueue/AbstractHandler.php(122): ...->performAction('delete', ...)
#3 src/XF/Job/ApprovalQueueProcess.php(67)
Cause: in Thread.php (lines 63-67) and Post.php (lines 61-64) the raw moderator reason is assigned to $deletionLog->delete_reason and saved. XF\Entity\DeletionLog defines delete_reason as STR maxLength 100, so a longer reason throws on save. Because parent::actionDelete() runs first, the content IS deleted, but the exception prevents the queue record from being removed.
Suggested fix (what I applied locally):
$deletionLog->delete_reason = utf8_substr($reason, 0, 100);
(same in Post.php) — or raise/validate the limit before save.
Thanks.