Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Pyrhel on January 20, 2023, 03:30:41 AM

Title: "Wrong value type sent to the database." on post editing, SMF 2.1.3
Post by: Pyrhel on January 20, 2023, 03:30:41 AM
Few times now I'm seeing the following error:

QuoteWrong value type sent to the database. Array of integers expected. (preview_attachments)
Function: prepareAttachsByMsg
in Sources/Subs-Attachments.php, Line 14.

This happens when I try to save a post, which I have opened for a moderation.
The post DOES NOT have any attachments and this is not happening always.

The worst moment is that this error is displayed on every page no mater what until I logout and login again.
I'm seeing in the logs that other users in my forum have the same problem.
Title: Re: "Wrong value type sent to the database." on post editing, SMF 2.1.3
Post by: TwitchisMental on January 20, 2023, 09:39:53 PM
Do you have any mods currently installed?

Are you using a custom theme?

Can you give a step by step on how to reproduce the issue you are having?
Title: Re: "Wrong value type sent to the database." on post editing, SMF 2.1.3
Post by: Pyrhel on January 21, 2023, 11:18:28 AM
I'm using the default theme with the following mods installed:
- Alternate User Posting
- Ad Management
- Yet Another Spoiler Mod
- Automatic Attachment Rotation (and Resize)

Steps to reproduce:
1. Someone posts;
2. I open their post for moderation;
3. On save, the error occurs, but the edits are saved;
4. From now on the error appears on every page and no other content is loaded until I logout and then login.

As mentioned above, this happens rarely and I cant see anything in common between the posts or topics with errors.
Above I made a mistake, the line in Subs-Attachments.php is 1488, NOT 14
Title: Re: "Wrong value type sent to the database." on post editing, SMF 2.1.3
Post by: TwitchisMental on January 21, 2023, 12:48:15 PM
Tried to replicate this myself and no luck.

I am suspecting this is related to a mod. I would suggest disabling all mods right now and see if you can then reproduce the error again.

If so try to provide as much detail as possible on replicating it.