Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Getting an error when trying to post a link with Anonymouse plugin

HalfCatHalfCat ✭✭
edited March 2013 in Vanilla 2.0 - 2.8

This is the error I get:

FATAL ERROR IN: Gdn_Database.Query();

"Duplicate entry '0' for key 'PRIMARY'" insert GDN_AnonymousComment (IntIp, Name, CommentID) values (:IntIp, :Name, :CommentID) LOCATION: C:\wamp\www\redesign2\vanilla\library\database\class.database.php > 276: > 277: if (!is_object($PDOStatement)) { > 278: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR); > 279: } else if ($PDOStatement->execute($InputParameters) === FALSE) { >>> 280: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR); > 281: } > 282: } else { > 283: $PDOStatement = $this->Connection()->query($Sql); > 284: } BACKTRACE: [C:\wamp\www\redesign2\vanilla\library\database\class.database.php] PHP::Gdn_ErrorHandler(); [C:\wamp\www\redesign2\vanilla\library\database\class.database.php 280] PHP::trigger_error(); [C:\wamp\www\redesign2\vanilla\library\database\class.sqldriver.php 1650] Gdn_Database->Query(); [C:\wamp\www\redesign2\vanilla\library\database\class.sqldriver.php 1121] Gdn_SQLDriver->Query(); [C:\wamp\www\redesign2\vanilla\plugins\Anonymouse\class.anonymousmodel.php 17] Gdn_SQLDriver->Insert(); [C:\wamp\www\redesign2\vanilla\plugins\Anonymouse\class.anonymouse.plugin.php 412] AnonymousModel::StaticSave(); [C:\wamp\www\redesign2\vanilla\library\core\class.pluginmanager.php 648] AnonymousePlugin->PostController_All_Handler(); [C:\wamp\www\redesign2\vanilla\library\core\class.pluginmanager.php 601] Gdn_PluginManager->CallEventHandler(); [C:\wamp\www\redesign2\vanilla\library\core\class.pluggable.php 127] Gdn_PluginManager->CallEventHandlers(); [C:\wamp\www\redesign2\vanilla\library\core\class.controller.php 451] Gdn_Pluggable->FireEvent(); [C:\wamp\www\redesign2\vanilla\applications\vanilla\controllers\class.vanillacontroller.php 44] Gdn_Controller->AddModule(); [C:\wamp\www\redesign2\vanilla\applications\vanilla\controllers\class.postcontroller.php 538] VanillaController->Initialize(); [C:\wamp\www\redesign2\vanilla\library\core\class.dispatcher.php 304] PostController->Initialize(); [C:\wamp\www\redesign2\vanilla\index.php 53] Gdn_Dispatcher->Dispatch();

Additionally, the comment is correctly added to the spam list in the dashboard, so this works fine. Apparently the error message that should be shown to the user trying to post a link is creating this error.

Any help is appreciated.

Answers

  • peregrineperegrine MVP
    edited June 2012

    The way you posted it, it is difficult to read.

    for some reason it thinks the comment id is 0 and it since Comment Id in the anonymous comment table is a primary key you can't have duplicate commentid's with the same number 0. Try deleting any comments in the table that begin with 0.

    Take a look at the table and look at the comment id's and try debugging and var_dumping object and echoing variables. around line 276

    and when you post errors try using the code "C" button on the buttonbar, so it is readable.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks for your reply. I actually tried using the code tags but I found it even worse looking...
    Anyways, I investigated a bit further and found out that the problem is actually caused by the interaction between the Akismet plugin with the Anonymouse plugin. However I wasn't (yet) able to find a fix. Looking further into it...

  • Yep, you're right about the 'code' tags and the 'pre' tags, or even the "C" button of the buttonbar. It depends on the 'source' which you copied from the error message, whether it looks good or not.

    There was an error rendering this rich post.

Sign In or Register to comment.