Joomla!
http://forum.joomla.org/

[SOLVED] - $database->insertObject changed
http://forum.joomla.org/viewtopic.php?f=378&t=26506
Page 1 of 1

Author:  wene [ Sun Dec 25, 2005 4:11 am ]
Post subject:  [SOLVED] - $database->insertObject changed

hello
i use $database->insertObject in the component im playing with.

when i updated to 1.0.5, i cant use this method anymore.

my browser tells me :
Fatal error: Call to undefined function: getpublicproperties() in (path)\includes\database.php on line 550

when i replace database.php with the 1.0.4 one, all is ok

i use it like :
$myobj = new stdclass;
$myobj->value1 = "a";
$myobj->value2 = "b";
$database->insertObject('#__mytable',$myobj );

after reading the code, i have seen that i should forget :
new stdclass
and use only
mosDBtable ?

Author:  Jinx [ Sun Dec 25, 2005 10:06 pm ]
Post subject:  Re: $database->insertObject changed

That is correct.

Author:  wene [ Mon Dec 26, 2005 1:20 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

thanks for attention

Author:  rasgar [ Mon Dec 26, 2005 1:40 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

Yeah this problem breaks the registration process in CB RC2

Thanks for the heads up!

Author:  crow [ Mon Dec 26, 2005 8:36 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

is there fixed database.php or i need to use old database.php from 1.0.4 as this also break user registration on Comunity Builder 1.0 RC2....?

Thnx

Author:  Jinx [ Mon Dec 26, 2005 3:07 pm ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

Use the old database.php from 1.0.4.

Author:  geeffland [ Tue Dec 27, 2005 5:42 pm ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

Is this a Joomla issue or an issue with the other software using the "new StdClass"??

Basically is it something that will be fixed in Joomla or something that needs to be fixed in the other software?

Author:  Corkys [ Tue Jan 10, 2006 10:26 pm ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

I have already upgraded to 1.0.5 - how do I back up to 1.0.4 please.

Author:  focalguy [ Wed Jan 11, 2006 12:07 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

wene wrote:
i use it like :
$myobj = new stdclass;
$myobj->value1 = "a";
$myobj->value2 = "b";
$database->insertObject('#__mytable',$myobj );

after reading the code, i have seen that i should forget :
new stdclass
and use only
mosDBtable ?

Just so I get this straight, how do you use 'mosDBtable' instead of 'new stdclass'? Just a straight replace or another method?

I've been working on a component and haven't upgraded to 1.0.5 yet but I'd like to know before I do.

Author:  de [ Wed Jan 11, 2006 10:17 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

focalguy wrote:
Just so I get this straight, how do you use 'mosDBtable' instead of 'new stdclass'? Just a straight replace or another method?

I've been working on a component and haven't upgraded to 1.0.5 yet but I'd like to know before I do.

Just look at the existing database classes... like mosMenu, mosContent etc. - they are sub classes of mosDBTable... if you want to use it ithout a sub class you would still need to provide the parameters, for example:
Code:
$obj =& new mosDBTable('#__tablename', 'id', $database);

Author:  focalguy [ Thu Jan 12, 2006 2:18 am ]
Post subject:  Re: [SOLVED] - $database->insertObject changed

Thanks de. I guess I'll figure it out when I work on it some more. I'm just kind of learning PHP as I go so I don't completely understand 'classes', creating new instances and everything. I just try to go off of existing code and read some PHP tutorials as I go along.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/