loadObjectList causes 500 exception - Joomla! Forum - community, help and support


i have component has been functioning since j1.5.
am trying upgrade 3.0
i have process trying add or drop column profile table.
this has worked fine in j 3.0 when tries execute select query gives me 500 exception.
here current code, have commented out older setquery statement , added jdatabase method both give me same exception.

code: select all

        //drop column profile fields
//$this->_db->setquery("select $this->name #__classifiedsredux_profile 1");
$query = $this->_db->getquery(true);
$query->select($this->name)
 ->from('#__classifiedsredux_profile')
 ->where( 1 );
$this->_db->setquery($query);
            $this->_db->loadobjectlist();
            if (!$this->_db->geterrornum()) {
               $this->_db->setquery("alter table #__classifiedsredux_profile drop `$this->name`");
               $result = $this->_db->execute();
            }


is bug or missing something??

yes bug. report it, found couple of other problems too.

hi beau18907,

please try that:

code: select all

$query->select($this->name)
$query->from('#__classifiedsredux_profile');

i guess want select rows table? if so, don't need clause.

further advise use quotename() function:

code: select all

$this->_db->setquery("alter table #__classifiedsredux_profile
drop". $this->_db->quotename($this->name));

good luck.





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support