deleting profile from admin area gives error

I am trying to delete profile/member from admin area & I get this error


Fatal error: Call to undefined method BxDolCmtsQuery::deleteObjectComments() in /home/YYY/public_html/xxx/inc/classes/BxDolCmts.php on line 229

though when I go back & check the profile is deleted but I somehow get this error.

Can anyone tell me how to fix this issue.

Thank

Quote · 20 Feb 2010

*bump*

Quote · 21 Feb 2010

We need the full error.  Right now I'd say that your table for Comments does not have a ObjectComments column in it.

Quote · 21 Feb 2010

This is the full error I see.Please let me know what I should tell in order to fix this issue.

you might be correct can you tell me how to solve this issue and add the column into the table.

Quote · 21 Feb 2010

Log into http://site_name.com/cpanel/ and then click on the phpMyAdmin Link and select your sites DB from the top of the left column.

 

Scroll down the left column until you see:

CmtsProfile

click on it.

 

Does yours look like this picture?

 

Quote · 21 Feb 2010

Yes it looks like this only, here is the screenshot:

http://img682.imageshack.us/img682/9144/phpmyadmin.jpg

<a target='_blank' title='ImageShack - Image And Video Hosting' href='http://img682.imageshack.us/i/phpmyadmin.jpg/'><img src='http://img682.imageshack.us/img682/9144/phpmyadmin.jpg' border='0'/></a>

Quote · 21 Feb 2010

sorry abt posting the link as it wasnt allowing me to post the pic here :(

Quote · 21 Feb 2010

 

sorry abt posting the link as it wasnt allowing me to post the pic here :(

 

Okay, your tables themselves are fine.  What is the string of code you that you have line 229 of inc/classes/BxDolCmts.php ?  Need more than just the one line, the entire function/string/query is what is needed.

Quote · 21 Feb 2010

this is the entire functionality near line 229 of /inc/classes/BxDolCmts.php.

/** comments functions
*********************************************/

function getCommentsArray ($iCmtParentId)
{
return $this->_oQuery->getComments ($this->getId(), $iCmtParentId, $this->_getAuthorId());
}

function getCommentRow ($iCmtId)
{
return $this->_oQuery->getComment ($this->getId(), $iCmtId, $this->_getAuthorId());
}

function onObjectDelete ($iObjectId = 0)
{
return $this->_oQuery->deleteObjectComments ($iObjectId ? $iObjectId : $this->getId());
}

// delete all profiles comments in all systems, if some replies exist, set this comment to anonymous
function onAuthorDelete ($iAuthorId)
{
for ( reset($this->_aSystems) ; list ($sSystem, $aSystem) = each ($this->_aSystems) ; )
{
$oQuery = new BxDolCmtsQuery($aSystem);
$oQuery->deleteAuthorComments ($iAuthorId);
}
return true;
}

function getCommentsTableName ()
{
return $this->_oQuery->getTableName ();  
}

function getObjectCommentsCount ($iObjectId = 0)
{
return $this->_oQuery->getObjectCommentsCount ($iObjectId ? $iObjectId : $this->getId());
}

Quote · 21 Feb 2010

This is your error:

 Fatal error: Call to undefined method BxDolCmtsQuery::deleteObjectComments() in /home/YYY/public_html/xxx/inc/classes/BxDolCmts.php on line 229

And this is your code around line 229.  The full functions.

this is the entire functionality near line 229 of /inc/classes/BxDolCmts.php.

 

 

/** comments functions
*********************************************/

function getCommentsArray ($iCmtParentId)
{
return $this->_oQuery->getComments ($this->getId(), $iCmtParentId, $this->_getAuthorId());
}

function getCommentRow ($iCmtId)
{
return $this->_oQuery->getComment ($this->getId(), $iCmtId, $this->_getAuthorId());
}

function onObjectDelete ($iObjectId = 0)
{
return $this->_oQuery->deleteObjectComments ($iObjectId ? $iObjectId : $this->getId());
}

// delete all profiles comments in all systems, if some replies exist, set this comment to anonymous
function onAuthorDelete ($iAuthorId)
{
for ( reset($this->_aSystems) ; list ($sSystem, $aSystem) = each ($this->_aSystems) ; )
{
$oQuery = new BxDolCmtsQuery($aSystem);
$oQuery->deleteAuthorComments ($iAuthorId);
}
return true;
}

function getCommentsTableName ()
{
return $this->_oQuery->getTableName ();  
}

function getObjectCommentsCount ($iObjectId = 0)
{
return $this->_oQuery->getObjectCommentsCount ($iObjectId ? $iObjectId : $this->getId());
}

 

 

 Just making sure and trying to bring it all together so we don't have to scroll to go from code to error and back.

Quote · 21 Feb 2010

This is your error:

Fatal error: Call to undefined method BxDolCmtsQuery::deleteObjectComments() in /home/YYY/public_html/xxx/inc/classes/BxDolCmts.php on line 229

And this is your code around line 229.  The full functions.

this is the entire functionality near line 229 of /inc/classes/BxDolCmts.php.

/** comments functions
*********************************************/

function getCommentsArray ($iCmtParentId)
{
return $this->_oQuery->getComments ($this->getId(), $iCmtParentId, $this->_getAuthorId());
}

function getCommentRow ($iCmtId)
{
return $this->_oQuery->getComment ($this->getId(), $iCmtId, $this->_getAuthorId());
}

function onObjectDelete ($iObjectId = 0)
{
return $this->_oQuery->deleteObjectComments ($iObjectId ? $iObjectId : $this->getId());
}

// delete all profiles comments in all systems, if some replies exist, set this comment to anonymous
function onAuthorDelete ($iAuthorId)
{
for ( reset($this->_aSystems) ; list ($sSystem, $aSystem) = each ($this->_aSystems) ; )
{
$oQuery = new BxDolCmtsQuery($aSystem);
$oQuery->deleteAuthorComments ($iAuthorId);
}
return true;
}

function getCommentsTableName ()
{
return $this->_oQuery->getTableName ();  
}

function getObjectCommentsCount ($iObjectId = 0)
{
return $this->_oQuery->getObjectCommentsCount ($iObjectId ? $iObjectId : $this->getId());
}

Just making sure and trying to bring it all together so we don't have to scroll to go from code to error and back.

Yes thats the error & this is the code starting from line 214 to 251. I don't see any error here s I am wondering what can be possible culprit

Quote · 21 Feb 2010

Okay, what mods have you done to this?  Right now your table is there as it should be correctly, it has the right columns and the code at line 229 is fine.  No issues with that in comparison to an original inc/classes/BxDolCmnts.php file.  I am curious, as to what line exactly you have as 229.  The reason I ask is because the ObojectID is not declared anywhere that your site is finding it when it comes to Profile Comments.  Is your site showing profile comments at all?  Can you leave a comment on a profile? 

 

 

Also, please show the last 3 functions in your inc/classes/BxDolCmtsQuery.php  file.  I'm thinking that is where your issue as, as that is where it declares the ObjectId to be deleted actually.

Quote · 21 Feb 2010

Okay, what mods have you done to this?  Right now your table is there as it should be correctly, it has the right columns and the code at line 229 is fine.  No issues with that in comparison to an original inc/classes/BxDolCmnts.php file.  I am curious, as to what line exactly you have as 229.  The reason I ask is because the ObojectID is not declared anywhere that your site is finding it when it comes to Profile Comments.  Is your site showing profile comments at all?  Can you leave a comment on a profile?

Also, please show the last 3 functions in your inc/classes/BxDolCmtsQuery.php  file.  I'm thinking that is where your issue as, as that is where it declares the ObjectId to be deleted actually.

the exact line 229 is :

return $this->_oQuery->deleteObjectComments ($iObjectId ? $iObjectId : $this->getId());

Yes I can leave comments on a profile so commenting feature is working.

here is the last 3 functions of inc/classes/BxDolCmtsQuery.php

function deleteAuthorComments ($iAuthorId)
{
$isDelOccured = 0;
$a = $this->getAll ("SELECT `cmt_id`, `cmt_parent_id` FROM {$this->_sTable} WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` = 0");
for ( reset($a) ; list (, $r) = each ($a) ; )
{           
$this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_id` = '{$r['cmt_id']}'");
$this->query ("UPDATE {$this->_sTable} SET `cmt_replies` = `cmt_replies` - 1 WHERE `cmt_id` = '{$r['cmt_parent_id']}'");
$isDelOccured = 1;
}
$this->query ("UPDATE {$this->_sTable} SET `cmt_author_id` = 0 WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` != 0");
if ($isDelOccured)
$this->query ("OPTIMIZE TABLE {$this->_sTable}");
}

function deleteObjectComments ($iObjectId)
{
$this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
$this->query ("OPTIMIZE TABLE {$this->_sTable}");
}   

function getObjectCommentsCount ($iObjectId)
{
return $this->getOne ("SELECT COUNT(*) FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
}
}
}

?>

Quote · 21 Feb 2010

Step 1:  Don't know if this is your full issue, but here is the end of default:  inc/classes/BxDolCmtsQuery.php file

 


function deleteAuthorComments ($iAuthorId)
    {
        $isDelOccured = 0;
        $a = $this->getAll ("SELECT `cmt_id`, `cmt_parent_id` FROM {$this->_sTable} WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` = 0");
        for ( reset($a) ; list (, $r) = each ($a) ; )
        {           
            $this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_id` = '{$r['cmt_id']}'");
            $this->query ("UPDATE {$this->_sTable} SET `cmt_replies` = `cmt_replies` - 1 WHERE `cmt_id` = '{$r['cmt_parent_id']}'");
            $isDelOccured = 1;
        }
        $this->query ("UPDATE {$this->_sTable} SET `cmt_author_id` = 0 WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` != 0");
        if ($isDelOccured)
            $this->query ("OPTIMIZE TABLE {$this->_sTable}");
    }

    function deleteObjectComments ($iObjectId)
    {
        $this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
        $this->query ("OPTIMIZE TABLE {$this->_sTable}");
    }   

    function getObjectCommentsCount ($iObjectId)
    {
        return $this->getOne ("SELECT COUNT(*) FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
    }
}


?>


Note you end the file with:

 

function getObjectCommentsCount ($iObjectId)
{
return $this->getOne ("SELECT COUNT(*) FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
}
}
}

?>


 

Note the "}" that I have marked on your copy.  Why do you have 3 at the end of yours?  Open the file up in Notepad++ and make sure that ever closing } has an opening bracket on it.  Not sure why you have 3 on the end when the functions are only calling for 2. 

inc/classes/BxDolCmtsQuery.php the base install has 204 lines to it.  Has yours been modified?

 

 

 

 

 

Quote · 21 Feb 2010

Step 1:  Don't know if this is your full issue, but here is the end of default:  inc/classes/BxDolCmtsQuery.php file


function deleteAuthorComments ($iAuthorId)
{
$isDelOccured = 0;
$a = $this->getAll ("SELECT `cmt_id`, `cmt_parent_id` FROM {$this->_sTable} WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` = 0");
for ( reset($a) ; list (, $r) = each ($a) ; )
{           
$this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_id` = '{$r['cmt_id']}'");
$this->query ("UPDATE {$this->_sTable} SET `cmt_replies` = `cmt_replies` - 1 WHERE `cmt_id` = '{$r['cmt_parent_id']}'");
$isDelOccured = 1;
}
$this->query ("UPDATE {$this->_sTable} SET `cmt_author_id` = 0 WHERE `cmt_author_id` = '$iAuthorId' AND `cmt_replies` != 0");
if ($isDelOccured)
$this->query ("OPTIMIZE TABLE {$this->_sTable}");
}

function deleteObjectComments ($iObjectId)
{
$this->query ("DELETE FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
$this->query ("OPTIMIZE TABLE {$this->_sTable}");
}

function getObjectCommentsCount ($iObjectId)
{
return $this->getOne ("SELECT COUNT(*) FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
}
}


?>


Note you end the file with:

function getObjectCommentsCount ($iObjectId)
{
return $this->getOne ("SELECT COUNT(*) FROM {$this->_sTable} WHERE `cmt_object_id` = '$iObjectId'");
}
}
}

?>


Note the "}" that I have marked on your copy.  Why do you have 3 at the end of yours?  Open the file up in Notepad++ and make sure that ever closing } has an opening bracket on it.  Not sure why you have 3 on the end when the functions are only calling for 2.

inc/classes/BxDolCmtsQuery.php the base install has 204 lines to it.  Has yours been modified?

hey this solved the problem. I had a wrong closing tag the number of closing tags were fine but 1 of the closing brackets were incorrectly placed which caused the problem.

Thanks alot this is great :)

Quote · 22 Feb 2010

Congratulations, glad to see you got it straightened out.  Keep in mind, when your site throws errors you want to start checking at the spot it's calling the error (in your case, the DB & line 299) then backtrace from there.  Always keep a copy of the script you installed (don't settle for a new download, you want the one you downloaded & installed from) and all mods that install.  By backtracing you can usually find just about anything and if you can't find it, come on in and grab a fresh set of eyes. 

Again, glad you got it ironed it.

Quote · 22 Feb 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.