Arrow

DB Error (table creation) | Peter's Custom Anti-Spam for WordPress | Forum

Back to the custom anti-spam plugin page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
DB Error (table creation)
September 3, 2007
10:34 pm
Newbie
Guest

I'm a new user. I installed ver. 2.9.1 and had DB error showing tables don't exist. The topic below shows that it might be a permission problem, but my account has table creation permission. Thus, I installed ver. 2.9.0 and it works fine. Please check if there isn't any bug related to table creation in the latest version.

Thank you for the nice plug in:)

September 3, 2007
10:40 pm
Peter
Admin
Forum Posts: 841
Offline

Thanks for the feedback! The latest version has no changes to the table creation code, so I'm guessing it was just something weird when activating and deactivating the plugin. I have yet to figure out why WordPress sometimes doesn't want to create the tables...

For those who are having trouble with the database tables not being created, check out the post on creating the tables manually.

September 11, 2007
12:46 am
Peter
Admin
Forum Posts: 841
Offline

Version 2.9.2 fixes the table creation problem.

September 25, 2007
11:09 am
Marco Cimmino
Guest

Hi,
I'm the author of the cimy user extra fields plug-in.

Tables are not created because if you download the plug-in from
http://wordpress.org/extend/plugins/

then your zip file contains this dir:
peters-custom-anti-spam-image

but in your code you have hardcoded (not a good idea) this dir:
$cas_fontpath = "wp-content/plugins/custom-anti-spam/";

so all people installing from that package will never have tables creation because the plug-in will never throw installation function, renaming to custom-anti-spam will work.

See my plug-in, I have workarounded a bit this problem to automatically recognize the dir name.

hope this will help.

bye
Marco Cimmino

September 25, 2007
12:19 pm
Peter
Admin
Forum Posts: 841
Offline

Thanks for the feedback! I was hoping to cover that in the instructions at:

http://wordpress.org/extend/pl.....tallation/

But I guess that even if I made the instructions super-clear, I should still make it more intuitive. The problem is that the WordPress plugin system automatically gave me that folder name... I guess I'll either do the dynamic folder recognition or simply rename everything to refer to the folder peters-custom-anti-spam-image.

September 25, 2007
1:02 pm
Marco Cimmino
Guest

Yes instructions are clear, but do not expect that people will read them :)
They do the same with my plug-ins :D

In my opinion a plug-in shouldn't have a dir rename to get properly used, but it's only a opinion.

Anyway I pointed to you a solution, read it into my plug-in and feel free to copy if you want.

bye
Marco

September 25, 2007
1:10 pm
Peter
Admin
Forum Posts: 841
Offline

Yes, I will check that out. Thanks!

In case anybody's wondering, this is Marco's plugin (although he has a few):

http://www.cimatti.it/blog/cim.....ra-fields/

September 26, 2007
1:29 am
Peter
Admin
Forum Posts: 841
Offline

Dynamic folder name recognition now in Version 2.9.3.

September 26, 2007
6:01 am
Marco Cimmino
Guest

I'm sorry to say that 2.9.3 is still buggy about this.

Tried with folder name custom-anti-spam2 and it didn't create tables.

I repeat: the dir is still hardcoded in the code

add_action('activate_custom-anti-spam/custom_anti_spam.php', 'cas_install');

this is the problem, the activation function will never be throw because it looks to 'custom-anti-spam' dir ;)

September 26, 2007
12:20 pm
Peter
Admin
Forum Posts: 841
Offline
10

Good point. I was hasty and was looking at the setting that pointed to the fonts.

September 26, 2007
1:33 pm
Marco Cimmino
Guest
11

yes you have deleted 1/3 of the hardcoded dir, remaining 2/3: the activate and deactivate hooks

September 26, 2007
1:39 pm
Peter
Admin
Forum Posts: 841
Offline
12

Thanks. I have a working solution and will post it tonight (I'm guessing that's tomorrow for you :D )

September 26, 2007
11:46 pm
Peter
Admin
Forum Posts: 841
Offline
13

Ahhhh, fixed at last.