report email to a selected/all administrator(s) fails
error:
Wrong value type sent to the database. Array of integers expected. (attach_ids)
log:
https://mysite/index.php?action=pm;sa=report;l=-1
Wrong value type sent to the database. Array of integers expected. (attach_ids)
Function: sendpm
File: /var/www/html/Sources/Subs-Post.php
Line: 961
if (count($attachments) >= 1)
948: {
949: $parent_attachments = array();
950:
951: $request = $smcFunc['db_query']('', '
952: SELECT
953: id_attach
954: FROM {db_prefix}pm_attachments
955: WHERE id_attach IN ({array_int:attach_ids})
956: AND attachment_type = {int:not_thumb}',
957: array(
958: 'attach_ids' => $attachments,
959: 'not_thumb' => 0,
960: )
==>961: );
sorry, this is not an SMF problem as it works in vanilla. I will try to figure out which mod is causing this.
it was the Enhanced PM System mod (dougiefresh) that caused this but the mod is now gone so i'm not sure where you can move this post to (?)
I will PM dougiefresh and ask him what i should do.
Maybe you can move this to the Mods board ...
Since the mod board is for specific mod support threads I'm inclined to just leave it here. More experienced team members may have a better idea.
That's not core code, it's from a mod. Enhanced PM System was pulled by dougie, it's no longer on mod site. Where did you get it?
I got it ages when it was made available and I think I am on the last release.
my system is too complex to undo it so I will live with this bug unless dougie can help.
If you can identify the code in Subs-Post.php as being from that mod, you can try deleting it. Can't parse the mod, it's not on mod site, but if you have the patience you can unzip the package and see if you can determine which code was left behind when it uninstalled.
the mod is still installed and maybe I can try to fix it but it would take a lot of time to figure out what's going on.
I have PMed dougie asking for his advice, I'm hoping he can help me to make the appropriate changes even though the mod is unsupported.
the "Message" function has been modified to allow attachments.
I am quite happy with the EMS but it just has this bug which bothers me.
the function works ONLY in the test system (weird?) if you add an attachment to the PM that you want to report to Admin
silly me, i had removed EMS in testing, that's why it works.
the code that is reported in error was created by the "PM Attachments" mod.
Can you attach your Sources/Subs-Post.php file so that I can see what is going on there?
Thanks dougie but don't waste too much time on it, just if you can see anything obvious ... sorry about the delay.
The code in question comes from the PM attachments mod. Considering it works without the EPM mod, it is unlikely that the code itself is wrong. It's more probable that another function is calling the sendpm function with wrong arguments, which (unfortunately) is possible since the code makes alterations to the function declaration.... Without knowing what function is calling the sendpm function incorrectly, I can't even guess at which file to look at next....
no problem.
thanks for looking into it ... i have never had to use it and nobody has mentioned it to me so i can live quite happily without this function, anyway.
Quick fix.
In the file Subs-Post.php, find:
$str_attachments = '';
if (count($attachments) >= 1)
Replace:
$str_attachments = '';
if(!is_array($attachments))
$attachments = array();
if (count($attachments) >= 1)
yeah ? i will give it a try ... thanks mate !
works well ! thanks again,