when you click on the send private message the error ""warning: Attempt to assign property of non-object in /var/www/html/modules/privatemsg/privatemsg.module on line 263." shows up on top of the send form. The To: textbox is empty and you have to type the username of the recipient or if you have previously sent a message then you can select a username on the contact dropdown. Everything else seems to work including sending messages and replying to messages.

Comments

gte451f’s picture

Confirmed sigthing on Lamp stack

Fedora Core 1
Apache 2.x
Mysql 4.x
PHP 5.0x

drumm’s picture

There are a few links to this form. Which ones are broken?

jimmyharris’s picture

I'm getting this error when I click on the "Write to author" link at the bottom of a comment. The link that gives the error is http://localhost/privatemsg/msgto/1.

Using Drupal 4.7 beta 4, Privatemsg (4.7.0, 08/12/2005 - 00:27), Fedora core 4, Apache 2, MySQL 4.1, PHP5.

syawillim’s picture

Am getting same error, rolled back to PHP 4 and the error message is no longer generated but the "To" field is still not populated.

Patrick Nelson’s picture

Confirm - I'm getting this error too - and am on latest version of module with latest 4.7-CVS as of today

fool2’s picture

$msg->recipient = db_result(db_query("SELECT name FROM {users} WHERE uid = '%d'", $arg));

I think that's the line in question. $msg is an array in this case... But it needs to be an object.

So before switch($op) above it you need to put $msg = (object)($msg);

syawillim’s picture

Changing:
$msg->recipient = db_result(db_query("SELECT name FROM {users} WHERE uid = '%d'", $arg));

to:

$msg = (object)($msg);
$msg->recipient = db_result(db_query("SELECT name FROM {users} WHERE uid = '%d'", $arg));

resolves issue.

satori1984’s picture

+1

A patched privatemsg.module which addresses both this issue and the one stated at here can be found at http://drupal.org/node/60903

mindless’s picture

Assigned: Unassigned » mindless
Status: Active » Reviewed & tested by the community

I have included this change in 67612.

mindless’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)