Privatemsg overwrites page title for custom code. How do I correct it? I am using Private message as PHP in a block on the node of a page so that a person can contact the node author without having to leave the page. Here is the code:

$node = menu_get_object();
if ($node-&gt;uid != 0) {
module_load_include('pages.inc','privatemsg');
  $recipients = $node-&gt;uid;
print "&lt;div&gt;Contact " . $node-&gt;name ." about this post.&lt;/div&gt;";
  $subject = $node-&gt;title ." question.";
  print drupal_render(drupal_get_form('privatemsg_new', $recipients, $subject));
}


However, Private message hijacks the title of the entire page, and now every single node  value is 'Write so-and-so' a new message, instead of what the page title should actually be.

Thoughts on how to correct this?

You can check out what's happening here on the test server:

http://g.hokkaido-select.com/classifieds/cars-and-vehicles/motorcycles-and-scooters/2006-150cc-scooter (note, you have to be logged into see the block, but the page title error can still be seen)
I guess the private message form sets the title directly. A simple way round it might be to cache the current title before you render the form, then set it back again afterwards:

$stored_title = drupal_set_title();
print drupal_render(drupal_get_form('privatemsg_new', $recipients, $subject));
drupal_set_title($stored_title);