Hi there,
I've added a filefield to the private message form, and I'm trying to embed the form programmatically somewhere on my site. I've used this code:
module_load_include('pages.inc','privatemsg');
$to_uid = 3;
$subject = 'Something';
print drupal_render(drupal_get_form('privatemsg_new', $to_uid, $subject));
It all works fine except when I click the "upload" button for a file. Then I get some AJAX error that includes this:
"call to undefined function privatemsg_check_format_access()"
If I don't try to upload the file via AJAX and just submit the form it works fine, so it's only when there's an AJAX call. I guess the required files are not included.
Thank you for any advice!
Hubert.
Comments
Comment #1
gzveri commentedHere's the solution :
create a custom module and use hook form alter,
and form_load_include to include the required file (privatemsg.pages.inc)
oh, and don't forget to clear the cache
Comment #2
j.b commentedThanks #1
works
Comment #3
ptmkenny commentedComment #3.0
ptmkenny commentedbetter formatting
Comment #4
ggive commentedSolution working fine