Closed (fixed)
Project:
Event
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Apr 2007 at 00:16 UTC
Updated:
22 May 2007 at 23:31 UTC
Jump to comment: Most recent file
This patch is basically functional except for a problem with the event_timezones table import, which doesn't like negative values (e.g. -09:00) for the data type time. I'm not quite sure how to handle this yet; perhaps just add 24 hours to the value, but I'm not sure that's even correct.
Tested against Drupal 5.1, Postgres 8.1.8, and Event 5.x-2.x-dev (2007-04-20 release).
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | event-5.x-2.x_postgres_4.patch | 8.66 KB | HorsePunchKid |
| #5 | event-5.x-2.x_postgres_3.patch | 7.67 KB | HorsePunchKid |
| #4 | event-5.x-2.x_postgres_2.patch | 7.66 KB | HorsePunchKid |
| #3 | event-5.x-2.x_postgres_1.patch | 6.49 KB | HorsePunchKid |
| event-5.x-2.x_postgres_install.patch | 1.92 KB | HorsePunchKid |
Comments
Comment #1
sammys commentedHi,
Great work on the patch! Looks good other than the line below:
This needs to become the following in line with Drupal naming convention for indexes (index -> idx):
I've eyeballed the code as i'm short of time and it looks solid.
Cheers,
Sammy Spets
Synerger
http://synerger.com
Comment #2
sammys commentedooo and the offset might be better implemented as a decimal type rather than the time type. In PostgreSQL:
Comment #3
HorsePunchKid commentedThis is still a work in progress, but here's a new patch against the current CVS head. New to this patch are support for Postgres installation (as opposed to just upgrading) and some Postgres fixes in
event.module.This patch still doesn't address the problem that Postgres's
timedata type doesn't support negative values. Theintervaldata type looks much better suited, but I haven't tried it out yet.Comment #4
HorsePunchKid commentedI switched over to using
intervalin Postgres, and it's working just about fine! The only problem I encountered is that if users don't have atimezone_idset, a join fails and no time shows up for the events. Going to the user edit page to set a timezone brings up another problem:UPDATE d_users SET timezone = '58|-21600'...That timezone won't fit into the
varchar(8)thatusers.timezoneis declared as. That said, thetimezone_idstill appeared to get set correctly.Anyway, this patch is looking pretty good now, though I have still not tested it thoroughly.
Comment #5
HorsePunchKid commentedWith this patch, I can now fully uninstall and reinstall the module successfully. The only problems that came up this time around were again default zero timezones and problems changing the timezone as described above.
Comment #6
killes@www.drop.org commentedExcellent, I've applied the patch.
There is another function which needs to be looked at: event_get_events. It is used by both the rss and the ical feeds and other stuff.
Also, the event_block_upcoming query.
Comment #7
HorsePunchKid commentedI looked through most of the queries to see if I could figure out what usually needs to get changed to make a MySQL-dialect query work with Postgres. Here's what I've observed so far:
How about a simple function, say
_event_rewrite_sql($query)? It would encapsulate the translation logic, doing theswitch($GLOBALS['db_type'])and regex work to massage the queries. Perhaps this would be better done in one of thedb_functions, but I presume it's better to get it working here first.Comment #8
killes@www.drop.org commentedI'd prefer to not have a rewrite function, however we should document your findings in a code comment in event_get_events. There are only three places where we need to distinguish between mysql and pgsql.
Comment #9
HorsePunchKid commentedThis approach seems to be more or less working for me. There's a problem with the calendar; it shows the events I add as starting on the 2nd of the month regardless of their actual start date. I think this is unrelated to my change, just because (using the Devel module) the queries seem to be returning the correct data.
The translation function I have so far looks like:
Comment #10
killes@www.drop.org commentedWhile it looks like it would work, I still don't like it. It is too much overhead for only three queries that need to be rewritten.
WRT to you 2nd of the month problem: Which calendar view are you using?
Also:
UPDATE d_users SET timezone = '58|-21600'...
This should not be happening. These two values need to go in two different columns.
Comment #11
HorsePunchKid commentedThat's fine; I can whip up a patch that inlines that function and also drops a comment where you suggested. (It will probably be too verbose; please edit freely!)
The problem with the calendar appears in both the calendar block and at
/eventin the month, table, and list views at least. The upcoming events block shows the correct events but the parentheses that should contain the time-until are empty. I should reinstall the latest version before I scratch my head too much more about those problems.I thought that user update query was odd, too. Whatever was going on is not going on now, and I was able to get my
timezoneandtimezone_idset without going into the database.Comment #12
HorsePunchKid commentedHere's a patch against the latest event-5.x-2.x-dev (08-May-2007 12:12).
This time around, I installed the module from scratch and used CCK instead of basicevent. The problems with labeling the title and body fields disappeared, of course, but the problem with the calendar page and block persists (events start to appear on the 2nd of the month, but the days on which they start and end are properly labeled with the time).
Comment #13
killes@www.drop.org commentedpatch applied. I am marking this fixed. yay!
Comment #14
(not verified) commented