PDA

View Full Version : Hook : Fatal error. Is it a bug ???


marocnl
01-29-2009, 07:34 PM
Hi All,

I placed a very simple code as hook in location userdata_postsave
$db->query_write('INSERT INTO pl_usr_user_attribute2 (log_txt) VALUES ("stvbart");');
I got the following error
Fatal error: Call to a member function query_write() on a non-object in C:\wamp\www\etnoselect\forums\includes\class_dm_us er.php(1938) : eval()'d code on line 50
Looks like similar to this bug :
http://www.vbulletin.com/forum/showthread.php?t=290637
But I check files and no DB instead of db was found.

I am using vBulletin 3.8.0

Thanks for your help.

ragtek
01-29-2009, 07:42 PM
You have to use $this->dbobject instead of $db !
That means:$this->dbobject->query_write(...

Dismounted
01-30-2009, 03:38 AM
Did you have a look inside class_dm_user.php, where the hook is located? You wouldh ave found how the DB object is called.

marocnl
02-03-2009, 09:24 AM
Thanks a lot. I will go deeper into vB code next time ;)