Needs review
Project:
CCK Date Testsite
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2008 at 11:05 UTC
Updated:
28 Nov 2008 at 21:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
karens commentedThis patch will automatically create a calendar for each of the test dates. It adds a requirement for views and calendar, but it's handy to be able to see the created dates in a calendar.
It could also be done differently -- adding all dates to the same calendar -- but this patch makes a separate calendar for each.
Comment #2
karens commentedComment #3
dwwI like separate calendars for each type. It think it'd get *way* too confusing if they were all on the same calendar by default. ;)
That said, would it be possible to have a /calendar-all view, too? and/or a /calendar-(date|datestamp|datetime)-all for all subtypes?
I rerolled the patch to add a new configuration define (CCKDATETEST_ENABLE_CALENDAR) to control if this stuff happens. I know I frequently need to test signup with and without views, so it'd be nice not to always have the the calendars (though I'm happy to leave that constant default to TRUE). This patch will conflict with #338053: Add Date PHP4 since it's touching the same code, but that'll be easy to resolve. I also fixed a few whitespace problems and fixed the variable_set('calendar_default_view_options') to only get called if any calendar options were defined (e.g. if I site for some reason was installed with only the untimed content type or something).
Comment #4
dwwRemoved the PHP4 stuff, updated the README, and committed to HEAD. Thanks.
Comment #5
karens commentedAfter working with this, I found that creating separate calendars for each date can bomb the server during the install process, and if we add more date options (like the repeat date fields I need to add) it gets even worse. I re-worked this to create a separate calendar for each type of timezone handling, so there will just be four calendars instead of a dozen calendars. And looking at all the fields that use the same timezone handling on the same calendar makes more sense anyway.
So here's a patch to switch that around.
Comment #6
karens commentedI guess you could also make a case for creating a separate calendar for each date type instead of each timezone handling type. The patch could be reworked to do that instead or to offer an option.
We don't want to do both, though, since we need to limit the number of default views we create. I found that the server went bananas when I added a few more fields and tried to create calendars for all of them. MYSQL server went away... MYSQL server went away... Over and over.