Wordpress Plugin not actually saving events

Server Configuration

  • New install of WordPress 2.9.2
  • Operating System: Windows Server 2003 w/SP2
  • PHP 5.1.2
  • MySQL 5.1.41

WordPress Configuration

  • Theme: WordPress Default 1.6
  • Plugin: Akismet 2.2.9 (Inactive)
  • Plugin: Avatars 7.5
  • Plugin: Event Calendar / Scheduler 2.0
  • Plugin: NextGEN Gallery 1.5.3
  • Plugin: Smart Youtube 3.6.1
  • Plugin: WPtouch iPhone Theme 1.9.13

Event Calendar / Scheduler Configuration

  • All users except Guest and Subscriber has full control to calendar
  • Upcoming Events widget added to sidebar via Appearance --> Widgets

Description of Problem
My apologies for being a complete newbie so if the solution is elementary, please excuse my ignorance. I tried looking through the documentation and this forum but found nothing resembling my problem.

Everything seems to work perfectly. Events can be added on one day, then the next and so on but as soon as you move to a different page and then back to the calendar page, all the events are gone (never really saved).

Same problem when adding events in the Scheduler control panel (Plugins --> Scheduler --> Events Administration). You can add several events and they remain if you visit other tabs like Settings, Access Rights, Templates but if you go to some other page, the events will disappear.

It is acting like it cannot save the events. Does this plugin save to the same location that WordPress uses such as the MySQL database or is it trying to manipulate an XML file on the server? If it is trying to manipulate a file, can I easily change it to use the MySQL database?

Thanks,
LHammonds

Plugin saves data to the WP’s database.
When activated first time, plugin creates new table “{WP-Prefix}events_rec”

When you are changing data in client side scheduler, do events change text color of red? ( this is default response on DB saving error ) ?

Yes, the text initially is black for a fraction of a second and turns red.

I feel the next thing you are going to ask is to turn debug mode on. I just now did but I do not know where to find the debug log.

Is there supposed to be a reports.xml file in the plugins folder or the “event-calendar-scheduler” folder? I have create and write permission for both folders right now. Restarted IIS but still does not create any log files.

Thanks,
LHammonds

If problem is still actual - in few days we are releasing the updated version of plugin which may be able to resolve issue in your case ( problem can be caused by incorrect DB table creation, which causes problem for event saving )

I looked in the MySQL database and I see the “wp_events_rec” table.

One thing that looks different from all the other tables is that the “Engine” column for all the other tables is InnoDB but the “wp_events_rec” shows it to be a “MyISAM” engine with zero rows.

I edited the table and changed it to InnoDB and executed the change but the event creation still shows red text and no rows being added to the table.

I did a maintenance table check but it shows no problem.

These are the column definitions that I see:

event_id, int(11), autoinc, primary key, not null
start_date, datetime, not null
end_date, datetime, not null
text, varchar(255), not null
rec_type, varchar(64), not null
event_pid, int(11), not null
event_length, int(11), not null

Please try to use the updated version
viewtopic.php?f=16&t=13763

I downloaded the BETA (June 22, 2010) and extracted the contents over the existing plugin.

I went into WordPress, brought up the calendar and tried to add a test event. Just as before, it initially showed as black text but quickly turned red.

It has now extra logging ability, if you have “debug mode” enabled in plugins folder you will have “scheduler_log.txt” - scroll to end of that file, and you will have the SQL command which was used to save data and failed (based on server configuration it may also include detailed error info), you can try to exec it directly against DB and check what is wrong.

I found the log file and looked at the last insert SQL:

I noticed that the “user” field was new so I checked and verified that the column existed in the table (it does).

When I ran the query (in Query Browser), it said

If it went any further, I assume it would also complain about event_length in the same manner, followed by errors in regards to no field allows null values.

Not sure where to fix the missing data.

EDIT: I went one step further and used the admin tool to insert an event since the add button does not prompt for any data. The following is the capture SQL:

As I suspected above, it is complaining about missing values. The exact error message is:

Every column/fieldname in the wp_events_rec table is configured with a checkmark in the “Not Null” column. I would think that the only values that should have a “Not Null” setting would be event_id, start_date, end_date and text. But even changing the Not Null settings would not fix the problem of an empty value trying to be inserted where it expects a numeric value (event_pid)

Thanks,
LHammonds

Plugin updated with code to workaround the reported issue.
support.dhtmlx.com/x-files/sched … ip?updated

Normally MySQL db converts empty string to 0 value automatically, it seems that in your case more strict db settings is applied.
In any case above link contains update which must enable DB saving, by providing default numeric value for pid column.

Thanks for your help so far!

Adding and Updating events via the Admin Control Panel now works and I can see the events by going into the normal view on the site.

However, adding new events or updating existing events via the normal view does not work.

The scheduler_log.txt shows the following:

When I run the SQL query above in MySQL Query Browser, I get the following error message:

Regarding the Normal vs More Strict mode of MySQL, I am not sure what settings during install affects that setting. I have not “tweaked” any settings on the server other than making it auto-backup the defined databases to a network share on a regular basis. If it would help, I have the click-for-click install instructions that I have documented (and follow when re-installing).

Thanks,
LHammonds

One more update added, version can be taken from
support.dhtmlx.com/x-files/sched … p?update=2

Not sure as well. But exactly the same DB scheme seems work for one installation and fails for other ( very rare, but not limited to your case )

S U C C E S S ! ! !

Works like a champ! Many thanks. This was the last thing to get working before I could replace my old craptastic ASP Classic intranet with a brand-spanking new PHP intranet!

If I did not say thanks yet…THANKS!!!

This is an awesome calendar tool which I’ll be using straight out of the box without any customizations necessary.

Have a great day…and THANKS!

LHammonds

Hello my friend, thanks for this plugin :slight_smile:

I had the same problem, but i installed the second beta version and now i can save but when i check my php_error.log i see these errors everytime i check the scheduler page

[09-Dec-2010 22:44:18] Error Table 'wordpress.wp_blogs' doesn't exist de la base de datos de WordPress para la consulta SELECT * FROM wp_blogs LIMIT 1 realizada por require_once, require_once, require_once, require_once, include_once [09-Dec-2010 22:44:33] Error Table 'wordpress.wp_blogs' doesn't exist de la base de datos de WordPress para la consulta SELECT * FROM wp_blogs LIMIT 1 realizada por require, require_once, require_once, require_once, include_once [09-Dec-2010 22:44:35] Error Table 'wordpress.wp_blogs' doesn't exist de la base de datos de WordPress para la consulta SELECT * FROM wp_blogs LIMIT 1 realizada por require, require_once, include_once

Also i’m interested in use one scheduler per registered user, how can i do that?

And finally… this version is updated with the scheduler 2.3?

Thanks in advance for your help… have a nice day

Hello,

On “Access rights” tab of administrative panel you can find “Private mode” option. Maybe it’s the same functionality you need?

Wordpress and Joomla plugins have been updated to 2.3 version. Check out our blog post.

Best regards,
Ilya

Hi Ilya, thanks for reply :wink:

With private extended mode I resolved part of my problem. So to be more specific I’m using scheduler for a hospital and each doctor has a page on wordpress so in this page must appear his/her own scheduler and he/she has to see only his/her scheduler with his/her appointments.

So i don’t know how to make that, i hope you can help me

Hello,

Private mode extended — everyone see all events but can edit can only their own.
Normal private mode — everyone can see and edit only their own events.

So try changing your current mode and check if it helps.

Best regards,
Ilya

Hello,

Yes i used the private mode and i resolved part of my problem but i have one scheduler for the all site, and i need to have a scheduler per doctor, how can i do that?

Hi,

Probably i am missing something but if you turn the private mode on then only doctors who are assigned to the specific events will be able to see them. One doctor would not see what is assigned to the another one.
If it doesn’t help then please explain in detail what exactly doesn’t work for you and should be changed.

Best regards,
Ilya

Hi Ilya, it’s me again :stuck_out_tongue:

I’m gonna try to explain you in detail what i need.

  1. In the hostpital there are many doctors, each doctor has a page on a wordpress site and he/she needs his/her own scheduler in his/her own page.
  2. Clients can take appointments with the doctor they choose in a directory, and has to be registered to take them.

So i was reading other posts and the documentation and i was trying to attach a function in configurator.php to change the select, insert, update and delete of events to add a field that relate events with a doctor id, in the same table events_rec. And this doctor id could be the id of the page in wordpress to identify each doctor and manage just his/her events.

I hope it’s more clear now, and sorry for my english.