For some reason, each time I wanted to create an event on my website, there were two sets of dates (and times) that could be set as starting date and ending date of the event. One pair (pair A) just above the text field for the location, and another pair (pair B) just below the formatting options / Input formats (just below the text "More information about formatting options").
As I upgraded event 4.5.0 to 4.6.x a while ago, using the upgrading script that seemed to go smoothly, I am using flexinode. Initially I used Dutch descriptions of the start and end dates and this allowed me to conclude that pair A was the correct one.
Eventually, looking for the strings '<div class="container-inline">' and '<div class="day">', I found out that the function event_form_date() sets these strings; this function is then called on two other places in the code in event.module. Both places are in function event_nodeapi() around line 1662 ($Id: event.module,v 1.122.2.22 2005/10/03 01:25:21 killes Exp $).
Too much coincidence, so I disabled those two lines calling event_form_date and the second pair of invalid dates (pair B) disappeared. Great!
I haven't yet found any detrimental effects after this change, but I also haven't found anything else on this on the website; so I'm also unsure if this is a general problem or one that just I am experiencing.
Comments
Comment #1
Lappie commentedDespite initial checks, I was too quick on my last conclusion. There are detrimental effects. I get
warning: in_array(): Wrong datatype for second argument in /home/units/nvp/htdocs/modules/event/event.module on line 1810.Comment #2
Lappie commentedAnd the latter error was one because the first line you need to disable in
event_nodeapi()is one along the form$form = ..., with lines like$form .= ...following. So the above error just was a syntax error basically.Comment #3
Lappie commentedOh, and of course this means that you have to insert a
$form = "";on the same line where, originally, the first line was that you disabled.(oh, and I promise, from now on, I'll triple-read my follow-ups and wait five more minutes before submitting.)
Comment #4
Lappie commentedSilly me, having trouble understanding the workings of event.module. So, of course, I entered an Event calender setting for events (that I created via flexinode, per the instructed upgrade notes). This, I didn't understand, resulted in the double date pairs.
Then, trying to fix it the wrong way, I tried upgrading the event.module and thus, accidently introduced this bug, that I reported in issue #2. Which resulted in my akward attempts to solve it with the changes in the code. That didn't solve the problem though, as the code that I removed wasn't involved in the bug.
Unfortunately I still don't like the way how the dates are entered and previewed, but I will file some code and stuff in a new issue after I've had a sufficient amount of sleep.