Calendar Support for Recurring Events

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
ameagher
Forum Members
Forum Members
Posts: 39
Joined: Sun Aug 12, 2007 4:01 pm

Re: Calendar Support for Recurring Events

Post by ameagher »

Hey FantomCircuit,

Thanks!

Will try it out!

Anthony
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

Fantom....this is great.  We appreciate the contribution.

I completely deleted the Calendar folder I had on the server, and uploaded your folder.  My events remained, and now I see the recurring event selections when editing/creating events.  So, a good start.

The problem I'm having, is that when I try to add/edit an event, the app hangs for a minute, and then returns me to my calendar homepage saying the event was added, but alas, my event is not listed nor seen on the front end.  Do you know why this may be?  Did I install this incorrectly?

Thanks.

BTW...running 1.2 "Barbados" on PHP and MySQL 5.x
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

It's probably because the database doesn't have the new columns required. Did you uninstall the old calendar module using the uninstall link in the modules area, then install the new module by clicking the install link in the modules area?

Doing this will remove the old calendar table and create a new slightly different one. The downside to this is that you will loose all your old events. If you want to keep all your current data you should just be able to modify the database by running the sql query below (remember to change your table name if you are using a different table prefix. If you dont know what this means ignore it and you should be fine). 

Code: Select all

ALTER TABLE  `cms_module_calendar_events` ADD  `event_parent_id` INT NOT NULL DEFAULT  '0' AFTER  `event_date_end` ,
ADD  `event_recur_period` BIGINT NULL AFTER  `event_parent_id` ,
ADD  `event_date_end` DATETIME NULL AFTER  `event_recur_period`
Note that I have added 3 extra columns instead of 1 as stated before. The event_recur_period and event_date_end are just to keep track of the recurring period and the end recurring date to make it easy to edit a parent event. I thought I could get away without these but decided to add them as it makes things a bit clearer for the user.
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

Ok, so I was cheating a bit by trying to replace code, so I took your last advice and updated the DB tables.....

THis seemed to work, I could successfully add a recuring event and it displayed on the front end.  ;D

But now when I try to browse back in the admin panel, it always hangs and I cannot get back to the Calendar module at all. 

And now on the front end I get the following message:

Code: Select all

Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 554 bytes) in /htdocs/wgpc/modules/Calendar/function.displaycalendar.php on line 128
Is there a memory issue here?  Sorry to bother you again, but i feel like Im SOOOOO close.

Thanks in advance.  Sorry, not very good at the PHP thing....thanks for your patience.
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Please, tell me any problems you have - it helps me fix stuff :)

Did you try just adding an event or were you trying to edit an event? I ask because I still think there are some bugs in the editing code where it gets stuck in a loop - I never got memory errors though.

Were you trying to upload a picture at the time? If so, was it a large picture? This might have also been the cause of out of memory errors.

Lastly, how long did you tell it to recur for? eg, Daily, 100 years in to the future, or something less :) I'm not sure how it will handle really really huge numbers of recurrences (it's gone up to 500,000 events for me)
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

I added (not edited) an event.  It had a start date and time, and an end date and time.  It recurred daily for 6 days.  i had about 9 characters total in the whole post, no pix.

I'm actually surprised by the memory error myself....
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Thanks for the info :)

hmm, that's really weird. so you can only actually see 6 events on the frontend? I'm just wondering if it managed to get into some crazy loop or something else entirely.

So can you get back into the admin area of the calendar module or is it still taking forever?

If you have access to phpMyAdmin, can you run the SHOW PROCESSLIST query, just to make sure there isn't still something going on on the database level
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

hmm, that's really weird. so you can only actually see 6 events on the frontend? I'm just wondering if it managed to get into some crazy loop or something else entirely.
I COULD only see six, but thats what I had entered on the event originally, so in that sense it worked (when it worked that is, still getting the memory error)  Still getting A memory error, but it seems to toggle between these two every time I refresh:

Code: Select all

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 554 bytes) in /var/www/virtual/gohalo.net/htdocs/wgpc/modules/Calendar/function.displaycalendar.php on line 127
and

Code: Select all

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 319 bytes) in /var/www/virtual/gohalo.net/htdocs/wgpc/lib/adodb_lite/adodbSQL_drivers/mysql/mysql_driver.inc on line 348
Not sure if that helps.
So can you get back into the admin area of the calendar module or is it still taking forever?
OK, So i go into admin -> Content -> Calendar, it hangs for about 1.5 mins, and then I get a download dialog in FF with this file for download: moduleinterface.php

Just insanely odd.

If you have access to phpMyAdmin, can you run the SHOW PROCESSLIST query, just to make sure there isn't still something going on on the database level
Here is the only thing listed when I do a SHOW PROCESSLIST
Id  User  Host  db  Command  Time  State  Info
301644 vftp localhost vhcs2 Sleep 350   NULL
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Ok, you could try killing that process.

eg/

Code: Select all

KILL 301644
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

Killed it, back end and front end still having same problems.  ???

Good news is the process did not come back...  ;D


Nevermind....it came back again.
Last edited by deejmer on Wed Dec 12, 2007 4:56 am, edited 1 time in total.
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Hmm, yes, that is good news.

Could you try checking in your cms_module_calendar_events table to see how many records there are?
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

102,991 Rows

Is that what you are looking for?

(check your BB messages too, just sent you one to try to take this offline to stop from cluttering this thread....)
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Yep, got message. it appears that it has inserted too many rows for some reason - I'll take a look at the code tonight to try and figure out what went wrong.
User avatar
deejmer
Forum Members
Forum Members
Posts: 69
Joined: Thu Jan 11, 2007 7:32 pm

Re: Calendar Support for Recurring Events

Post by deejmer »

Thanks....
Glad we are working through this.  Once I find this to be stable enough, I will deploy it to a production site and draft step by step directions for installing this (dummy proof ones, for people like me) and share it back.  THanks for your hard work and patience on this.  I know a lot of people have been waiting for this.  (730 thread views). 

Give Fantom a Karma point if you appreciate him like I do!
User avatar
FantomCircuit
Forum Members
Forum Members
Posts: 75
Joined: Fri Nov 10, 2006 1:34 am
Location: Gold Coast, Australia

Re: Calendar Support for Recurring Events

Post by FantomCircuit »

Figured out the problem - was a minor fix. The adding function would get stuck in a loop if an end date was not set. All fixed now. If you have downloaded the update previously I strongly suggest that you get this updated version as the loop will cause out of memory errors (bad) or will fill your databse quite quickly (worse)
Post Reply

Return to “Modules/Add-Ons”