I'm calling this function from a node-item.tpl.php page:
drupal_get_form('privatemsg_new', $uid, "I want $title")

I get the error:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'privatemsg_new' was given in /var/www/donate/includes/form.inc on line 372.

I'm using Drupal 6 and the privatemsg module is installed.

CommentFileSizeAuthor
#7 move_functions.patch7.33 KBberdir

Comments

ram327’s picture

Status: Active » Fixed

I figured it out.

I just needed to include this:
module_load_include('pages.inc','privatemsg');

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

asinnema’s picture

I get the following error:

Fatal error: Call to undefined function _privatemsg_list_headers() in /home/lotl/domains/lotl.nl/public_html/sites/all/modules/privatemsg/privatemsg.module on line 884

This is around line 884:

  // tablesort_sql() generates a ORDER BY string. However, the "ORDER BY " part
  // is not needed and added by the query builder. Discard the first 9
  // characters of the string.
  $order_by = drupal_substr(tablesort_sql(_privatemsg_list_headers(FALSE, array_merge(array('subject', 'last_updated'), $fields))), 9);
  $fragments['order_by'][]  = $order_by;

I'd really appreciate help on this, the embed function sounds really useful for my case. :)

berdir’s picture

Status: Closed (fixed) » Active

What about reading comment #1 then ;)

Anyway, setting to active again so that we can move the function to the .module file.

asinnema’s picture

I read the first comment but it seemed to be a totally different problem. I'm not a php guru, so I wouldn't know if it had anything to do with my error. It just seemed like the right topic to post my question in.

Thanks for the fast response anyway, any help is appreciated.

berdir’s picture

Well, yes, this issue and your problem are something different, so it is actually your comment that is off-topic here ;)

However, #1 fixes both your problem and the original issue.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new7.33 KB

Patches moves the list header/thread functions back into the .module file.

berdir’s picture

Status: Needs review » Fixed

Commited.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.