This is my understanding of what is going on.

When a user is created they have no timezone assigned to them - they use the site wide default.
This seems to cause a key violation when saving events so the event does not appear in the calendar because it has a null start time.

Work around is to explicitly assign each user a timezone - but this means editing each user one at a time. This is not good!

to repeat just create a new user then try to create a new event using that user.

CommentFileSizeAuthor
#2 node-event.tpl_.php_.txt3.37 KBabamarus

Comments

abamarus’s picture

There are several issure I have resolved by hacking away in the module.

The default timezone stuff relies on the database having the same stuff in it that is hard coded into the module. To get rid of some of the timezones (including the one that the module uses as it's default) required hacking the id's in the module - in my case I wanted to change the default 0 offset from europe/london to GB so in function event_timezone_map I edited the id at line 3161 to be 380, which is the id from the database.

I think there must be a better way of doing this rather then having hard coded values. Perhaps a feature request for disabling timezones we don't want from the admin pages?

The next bug I made a hack to fix is previewing an event - it was causing errors because it was trying to turn a date from a string into an array when the date was already an array. I fixed this in the event_explode_date function by wrapping everything is an is_array test. If the parameter $date is already an array return it, otherwise do the other stuff. This would be line 2733.

This only leaves me with l10n issues with the output. Currently all dates are displayed in US format even though the time is given in local time for the user. I have not seen an easy solution to this.

I'd create a patch but I have no idea how!!! Plus my hacks are a bit on the sloppy side so it wouldn;t be the best patch ever.

I hope the info is useful to someone who can do a proper fix. Any help with the display issue gratefully accepted.

abamarus’s picture

StatusFileSize
new3.37 KB

I have also created a template for our theme directory that removes the time from events that have no time. I've attached it here for those who are interested in it.

abamarus’s picture

I got around the timezone display issue by changing the output formats to use the name of the month instead of the number - that way both the US users and the UK users are equally confused by the date format!!

I also had to assign a custom format to the site wide time zone, again to use the month name instead of the month number.

Again a hack but at least it gets the module is a usable state.

killes@www.drop.org’s picture

Status: Active » Postponed (maintainer needs more info)

I am not sure I fully understand what is going on and how to try reproduce this problem.
Can you paste the event related variables from the variables table?

Is the new user you mention trying to create an event or is he viewing one?

abamarus’s picture

The new user is trying to create an event.

Reproduce by going into the event_timezones table and removing a few timezones - which is the only way of making a site that only has a relevant subset of timezones available. My event_timezones table contains timezone id 380, 474 to 479 and 481 to 484.

Because of the hard coded nature of the timezone handling in the event module this will break things for you quite nicely.

kecinzer’s picture

Even if I set timezone, I still see this - "Date Timezone requirements: The Date Timezone module requires you to set the site timezone name."

pcool’s picture

I have the same bug. I solved it by allowing the user to set the timezone when adding an event (go to
Administer > Site configuration > Events > timezone handling

Event time zone input: *
0 Use the sitewide time zone
0 Use the time zone of the user editing or creating the event
V Allow users to set event time zones

killes@www.drop.org’s picture

So it appears you hacked the timezone table and now you complained that it doesn't work anymore? :p

killes@www.drop.org’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

The proper way to restrict the timezone choices for a user is the form_alter hook, not hacking the tz table.