privatemsg/privatemsg_attachments/privatemsg_attachments.module on line 84.
$form['attachments']['wrapper'] += _privatemsg_attachments_form($files);
// Execute submit function as validate, to have it executed before
// $form_state['validate_built_message'] is created.
array_unshift($form['submit']['#validate'], '_privatemsg_attachments_upload_submit');
if (isset($form['preview'])) {
array_unshift($form['preview']['#validate'], '_privatemsg_attachments_upload_submit');
}
Should be a check like
if(is_array($form['submit']['#validate']){
array_unshift($form['submit']['#validate'], '_privatemsg_attachments_upload_submit');
}else{
$form['submit']['#validate'][] = 'privatemsg_attachments_upload_submit';
}
Comments
Comment #1
berdirHave you made any customizations to the form?
Are you sure that you are using the most recent version of 6.x-2.x?
Because we can't simply add a check there. The #validate key must exist or it won't work.
We have tests that run this form and no warning is thrown, so it exists by default.
Comment #2
berdirClosing this issue as there has been no response in multiple weeks.
Comment #3
twiik commentedOpened it again as I just installed the latest dev version and got the same error.
warning: array_unshift() [function.array-unshift]: The first argument should be an array in /home/*/sites/all/modules/privatemsg/privatemsg_attachments/privatemsg_attachments.module on line 83.It appeared when the recipient was blocked because his mailbox is full. If he deletes a message the error goes away, but if he's full again it reappears.
Also, when I'm blocked from sending the attachment form is still visible even though the reply form is not.
Comment #4
berdirConfirmed, the fix is trivial, I actually thought of this case but forgot to add the return statement.
Comment #5
berdirCommited the patch.
Comment #6
berdirForgot to actually push the change, if anyone was wondering if this isn't part of the -dev release yet. Should be soon now!