Fixed "Please enter a value using 255 characters or fewer." when using the "Spam" function

V3NTUS

Well-known member
Affected version
2.1.7
I tried to disable every add-on to make sure it's not a bug/error caused by add-ons.

So here's how it happens: I hit the SPAM button to perform all the usual tasks to get rid of a spammer (delete messages, conversations, threads, ban the user and check the IP).

Outcome:

Screenshot_1.webp

If I untick the options one by one, I noticed it goes through, except if I leave ticked the "Ban spammer" option which, I guess, is somehow causing this glitch.

Now, nothing gets logged in the error console in the Admin Area, while in the Inspect Element's error console I get this weird error:

  1. {status: "error", errors: {…}, errorHtml: {…}, visitor: {…}, job: {…}}
    1. status: "error"
    2. errors: {ban: "Please enter a value using 255 characters or fewer."}
    3. errorHtml: {content: "↵↵<div class="blockMessage">↵ ↵ Please enter a value using 255 characters or fewer.↵ ↵</div>", title: "Something didn't go through.."}
    4. visitor: {conversations_unread: "187", alerts_unread: "4", total_unread: "191"}
    5. job: {manual: null, autoBlocking: null, autoBlockingMessage: null, auto: true}
    6. proto: Object
which seems to be related to the hide-refresh.js file (a debug message??).

I have no clue about why this happens and since we're dealing with hundreds of spammers every day, we'd like to find a solution to this problem or a way to debug it in order to find what's causing it.

Xenforo is upgraded to latest version, and if I manually just ban the user, it works fine, but from the Spam Cleaner, the ban caused this issue.

If you need other info, I'm here, thanks in advance!
 
Looking at the fields that we specify a 255 character limit for, the only field that is potentially involved in a default spam cleaner setup is the user ban reason. The reason used when spam cleaning is provided via the spam_cleaner_ban_reason phrase. Have you customized this? (Or has it been customized in a language pack?)
 
Thank you for your fast reply. Yes, it has been altered to include a ban appeals email the users can refer to, which probably makes it longer than 255 characters. Any ways to remove this limit or I need to stick with a shorter message?
 
You'd need to stick to a shorter message.

I'll leave this open though as we likely need to handle this more gracefully (likely trimming that phrase automatically).
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.1.8).

Change log:
Force max length constraint when handling a user ban reason.
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom