[Register]
Powered by Elgg

Plugins :: Blog :: Error when admin logs in

November 26, 2007

If you install the comment wall. (Error reporting set to 6135)

Login as an admin

You get this error as soon as you login.
==========================
Fatal error: mysql error: [1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1] in EXECUTE("select * from elgg_profile_commentwall where ident=") in /home/~user/public_html/elgg/lib/adodb/adodb-errorhandler.inc.php on line 77
==========================

The simple fix is:
line 71:

            if ($records = get_records_sql("select * from {$CFG->prefix}profile_commentwall where ident={$comment_id}")) {
                //delete the comment
                delete_records("profile_commentwall","ident",$comment_id);
                $_SESSION['messages'] = $messages;
                header("Location: {$CFG->wwwroot}" . user_info("username", page_owner()) . "/profile/");
                exit;
            }

I changed it to

		if(strlen(trim($comment_id))>0){
if ($records = get_records_sql("select * from {$CFG->prefix}profile_commentwall where ident={$comment_id}")) {
//delete the comment
delete_records("profile_commentwall","ident",$comment_id);
$_SESSION['messages'] = $messages;
header("Location: {$CFG->wwwroot}" . user_info("username", page_owner()) . "/profile/");
exit;
}
}

This is the simplest fix I could come up with.  Anyone have any idea why this is happening for admins? 

Posted by bigorangemachine @ Plugins


Comments

  1. You don't mention which file contains this error. Please add a ticket for this in the issue tracker.

    user iconMisja Hoebe on Monday, 26 November 2007, 12:00 UTC # |

  2. mod\commentwall\lib.php

    is the file.  Sorry I thought it was clear I was refering specifically to this plugin 

    user iconbigorangemachine on Monday, 26 November 2007, 16:16 UTC # |

  3. HOW DO I ADD A TICKET!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    user iconbigorangemachine on Thursday, 13 December 2007, 22:14 UTC # |

You must be logged in to post a comment.

Site supported by Curverider Ltd - powered by the awesome Elgg