Download & Extend

It is looking for a non existent table/no table is created

Project:Bad Behavior
Version:4.7.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

There is no mysql to import and it doesn't generate one. I double checked after downloading the module to see if there was a mysql because I keep getting pages and pages of the following two errors:

Table 'autism.bad_behavior_log' doesn't exist query: SELECT w.* FROM bad_behavior_log w ORDER BY w.date DESC LIMIT 0, 50 in ~/[drupal install]/includes/database.mysql.inc on line 120.

and

The third-party bad-behavior files are not installed. Please consult badbehavior/README.txt for details.

--

Now exactly what I did was download the module and get the bad behaviour files. In the bad behaviour zip from the other site it has "Bad-Behaviour" with a "bad-behaviour" inside it along with some other site type specific files ie a wordpress file and such. I take out the "bad-behaviour" directory and drop it in my ~/[install of drupal]/modules and drop the badbehaviour.module inside that. I then enabled it under modules in the admin panel.

So how do I fix this? The site is for a disability support group so I'd rather have this module enabled to prevent spammers and trolls.

Comments

#1

i'm having the same exact isssue.

#2

I, too, am having the same problem:

* user warning: Table 'thirdi_drpl1.bad_behavior_log' doesn't exist query: SELECT COUNT(*) FROM bad_behavior_log w in /home/thirdi/public_html/includes/database.mysql.inc on line 120.
* user warning: Table 'thirdi_drpl1.bad_behavior_log' doesn't exist query: SELECT w.* FROM bad_behavior_log w ORDER BY w.date DESC LIMIT 0, 50 in /home/thirdi/public_html/includes/database.mysql.inc on line 120.

I have downloaded Bad-Behavior 2.0.2
I have downloaded Badbehavior module for 4.7

I uploaded the bad-behavior directory to my module directory. I then uploaded the badbehavior module into the bad-behavior directory.

I activated the plugin. Went to Admin> Logs> Settings and found the above error message.

I'd really like to get this to work.

#3

I think what you need is

modules/badbehavior

containing badbehavior.module

and

modules/badbehavior/bad-behavior

being the bad-behavior directory that was inside Bad-behavior

#4

I don't believe the directory structure has anything to do with this. Bad-Behavior module package is missing the file badbehavior.install. This file would contain (among other things) the function badbehavior_install() to create the necessary database tables.

The fact this module works for other folks suggests they ahve created the necessary DB tables manually during module development and then forgot about it during successive upgrades. (I.e. they never testing installing module on a clean site that didn't already have DB schema in place).

Here is the function for creating the table, found in bad-behavior/core.inc.php

// Our log table structure
function bb2_table_structure($name)
{
        // It's not paranoia if they really are out to get you.
        $name_escaped = bb2_db_escape($name);
        return "CREATE TABLE IF NOT EXISTS `$name_escaped` (
                `id` INT(11) NOT NULL auto_increment,
                `ip` TEXT NOT NULL,
                `date` DATETIME NOT NULL default '0000-00-00 00:00:00',
                `request_method` TEXT NOT NULL,
                `request_uri` TEXT NOT NULL,
                `server_protocol` TEXT NOT NULL,
                `http_headers` TEXT NOT NULL,
                `user_agent` TEXT NOT NULL,
                `request_entity` TEXT NOT NULL,
                `key` TEXT NOT NULL,
                INDEX (`ip`(15)),
                INDEX (`user_agent`(10)),
                PRIMARY KEY (`id`) );"; // TODO: INDEX might need tuning
}

#5

I've work out a fix for this by patching the module. You can see it here:
http://drupal.org/node/172552#comment-657687

Please note this fix (and module file attached) are for Drupal 5.x and BB2!

#6

Status:active» closed (duplicate)

Duplicate of #366082: Does not work with database prefix

nobody click here