Events not registered...

Events not registered...

by Anders Berggren -
Number of replies: 6

Hi Jon!

Thanks for a great contribution! I have a problem though. Everything with my Calendar instance works just fine until I want to register events. They don't seem to be stored. The procedure ends with showing the correct date but informs that no event is registered and no event shows as marked on the Calendrar. My guess is that the database tables haven't been set up. I never saw the usual screen "Module tables set up successfully" etc.

Cheers, Anders

Average of ratings: -
In reply to Anders Berggren

Re: Events not registered...

by John Papaioannou -
Hi,

What version of Moodle are you using exactly? There is just one table required for the calendar to work, the mdl_event table. It's been over a month now (don't remember exactly) that the latest beta versions of Moodle include this table, so my guess is that for some reason you don't have it or have it wrong.

The correct table schema is:

CREATE TABLE prefix_event (
  id int(10) NOT NULL auto_increment,
  module int(10) NOT NULL default '0',
  instance int(10) NOT NULL default '0',
  name varchar(255) NOT NULL default '',
  description text NOT NULL,
  type varchar(20) NOT NULL default '',
  course int(10) NOT NULL default '1',
  timestart int(10) NOT NULL default '0',
  duration int(10) NOT NULL default '0',
  timemodified int(10) NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM COMMENT='for everything with a time associated to it';

See if this solves your problem.

Cheers,
Jon
In reply to John Papaioannou

Svar: Re: Events not registered...

by Anders Berggren -

Hi Jon!

Thanks for help. I had a fresh Moodle 1.2 instance, still I upgraded it today from CVS but the problem remains. Am I supposed to create the table in MySQL manually? I am a newbie to that but if you don't try you'll never know, will you?

Cheers, Anders

In reply to Anders Berggren

Re: Svar: Re: Events not registered...

by Bill White -
Hi Jon and Anders,

I have the same problem. I thought it was the Calendar was not high-lighting my events, but the Events were not registering. So I did some poking around and did not see any mdl_event table in mysql moodle database. I have Moodle Beta +++ 2004031300 instlled. So I tried to add the table into moodle using the CLI and that didn't work. I keep getting an error:

"ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'id int(10) NOT NULL auto_increment,
  module int(10) NOT NULL "

Then I noticed that Jon's code for adding the table started with:

"CREATE TABLE prefix_event ("

And I did see a table called "prefix_event" in my moodle database.

So now what should I do? should I delete this table and recreate it or should I change the above code to "CREATE TABLE mdl_event ("

Any hints?

Cheers,
Bill
In reply to Bill White

Re: Svar: Re: Events not registered...

by John Papaioannou -
Hi,

The correct name is "mdl_event", I kept the "prefix" part because that's how all SQL tables are represented in Moodle. In 99.9% of occasions, "prefix" equals "mdl", and that's how you should name it.

The SQL query to create the table is correct, I checked it, so if it fails it must be because there's already a mdl_event table in your database.

My guess is that you installed sometime in the past a beta (or Gustav's calendar module) which created this table with the wrong schema. That's why you can neither create it or get the calendar to work. Try deleting the table (drop it from the db) and creating it again. Hopefully this should solve your problem.

Cheers,
Jon
In reply to John Papaioannou

Re: Svar: Re: Events not registered...

by Bill White -
Jon,

Thanks for a wonderful addition to Moodle. I did install Gustav's calendar module a while back. This was most likely the cause of my problems. I decided to backup all my courses and do a complete reinstallation as I wanted to have it running in a prestine state come April for the new school year here in Japan.

Your calendar component is exactly what I needed and hoped for. Now if all goes well this academic year I plan to propose this to my 2 Universities here.

Again thank you and all those here at Moodle (Martin and developers) for making this the best LCMS around.

Cheers,
Bill
In reply to John Papaioannou

Svar: Re: Svar: Re: Events not registered...

by Anders Berggren -

Hi,

Thanks for the advice and the great Moodle work you're doing. Your analysis was correct in my case. Now I have another problem. The MySQLAdmin that I am using (running EasyPHP 1.9 on Win98) won't let me add all kinds of (constraint) properties to the attributes. There are e g table columns for declaring data types and NULL/NOT NULL values but there are no form text areas in them. This is a MySQLAdmin problem and not a Moodle one though. I am satisfied with your explanation which enlightened my understanding.  Eventually I'll find a complete solution.

Cheers, Anders