Categories added automatically

Support for the WordPress Calendar plugin
damsel
Posts: 4
Joined: Thu Sep 18, 2008 6:11 pm

Categories added automatically

Unread post by damsel » Fri Sep 19, 2008 9:34 am

Hello,
First of all I'ld like to thank you for this great piece of software. That's the kind of calendar I've looked for. Easy to handle, nice looking - great!.

Still I have a problem with its categories:
Whenever I click on anything that has to do with the Calendar it adds 2 more categories :-(.
When I click on Edit Event: 2 more categories are there. Deleting those categories? Yes ....but 2 new ones are created.
So eventually it'll fill up the database with unneeded categories.
I've found a workaround to prevent the script from doing that by declaring the categories item to be unique in the SQL database.

I wonder if anybody else has encountered that problem.

My installation:
Calendar 1.2.1 on wordpress 2.6
I've already disabled all the other plugins with no success, as well as changed the theme back to default ( no success either).

Thanks for help
damsel

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Categories added automatically

Unread post by Kieran » Fri Sep 19, 2008 11:49 pm

This is genuinely the first report of this kind that I've had, and I have to say, no matter what I try, I can't replicate it.

Can you provide some details of your web server to compliment the WordPress stats you have already given me? I can then try and replicate your problem.

damsel
Posts: 4
Joined: Thu Sep 18, 2008 6:11 pm

Re: Categories added automatically

Unread post by damsel » Sat Sep 20, 2008 7:56 am

At the moment ( till I'm completely happy with it) I still run Calendar only locally.
My Server is Apache 2.2
(Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1)

My PHP Version is PHP Version 5.2.1
My SQL Server is Server Version: 5.0.33

It all runs on a Windows XP SP2 machine.

I don't use SEO friendly links in WP.

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Categories added automatically

Unread post by Kieran » Sat Sep 20, 2008 4:30 pm

Declaring it to be unique shouldn't be needed; there is an auto-increment on category_id and it is also the primary key. The code to add the first category (id = 1) is only run either on upgrade or on first install so what you are seeing simply shouldn't be happening.

Try installing calendar fresh. Make sure the database tables are deleted first. When you first install calendar and visit one of the calendar admin pages (only visit one), check the database. What categories are there now? What is the lowest ID number? If you then visit another calendar page or refresh the one you are on, what happens to the database? What are the new ID numbers if any categories are created?

What I am assuming is that one of the queries is failing somehow which means the checks (which are done on page views) to see if calendar is properly installed or not are failing and thus are trying to add missing components, which would include adding a category. The thing is we need to determine which query your setup is failing to execute and why.

If, after a fresh install you could provide a dump of your calendar tables to me then we should be able to see if there are any things missing.

I have done a fresh install here and so can cross-check what you have with what I have. If they are the same however then we'll have to dig deeper.

damsel
Posts: 4
Joined: Thu Sep 18, 2008 6:11 pm

Re: Categories added automatically

Unread post by damsel » Sat Sep 20, 2008 5:28 pm

I've deleted everything from the database now, installed the plugin new.

There was 1 Category in the database ( Dump1)
Clicking on the Calendar Tab in the Admin Panel added 2 Categories.
Reloading the Admin Panal ( because I unfortunately closed that window) + 1Category.

Click on the Calendar Tab : + 2 Categories
Clicking on Manage Categories : +2 Categories
(8 Categories altogether now).

Dumps are attached
Attachments
calendar_dumps.zip
(6.13 KiB) Downloaded 480 times

User avatar
Kieran
Posts: 2059
Joined: Sat May 26, 2007 1:55 pm
Location: London
Contact:

Re: Categories added automatically

Unread post by Kieran » Sun Sep 21, 2008 2:57 pm

Ok, what is happening is each time a check is made to see if calendar is installed an extra category is added. Where that check is carried out twice, two are added.

In order for this to happen, one of the checks must be failing, even though the items to pass the checks are present in the database (I couldn't find anything amiss in your first dump compared with mine so nothing wrong with initial query execution.

Sadly I'm not able to setup a server identical to yours to debug so the only way we can fix this is if you do some debugging wrt the code.

The function you are looking for is check_calendar() and in there you will see a set of checks and queries which would be executed if they fail.

What you need to do is determine (by use of debugging or echo statements) which checks are failing and then from there, what queries are failing that cause the status to be incorrectly set.

If you could feed back your results (or possible fix) then I can update the plugin.

damsel
Posts: 4
Joined: Thu Sep 18, 2008 6:11 pm

Re: Categories added automatically

Unread post by damsel » Mon Sep 22, 2008 4:12 am

I wish my PHP knowledge would be better to do this.

Thanks for your assistance ...and time
nevertheless.

Post Reply