After upgrading to Date 6x-2.8 last week, newly created events no longer appear in the calendar (all previously created events do appear though). The newly created events appear in the content management list but all references to that event do not appear in any of the calendar views (month, week or day). I am kind of surprised no one else has noticed and reported this yet - so it make me wonder why I am special.

Using Date 6x-2.8, Calendar 6x-2.4, Drupal 6x.22

Comments

dwillcox’s picture

I see something similar, though I haven't tried exercising the events vs. old events.

What I find is that while the monthly and weekly calendars look right, the day view generally doesn't show anything. Sometimes it does, but I haven't figured out the pattern. Maybe only the first occurrence of a repeating date?

I've reverted to version 2.7.

scooper’s picture

I have the same problem as Comment #1 - some events show in Day view and others don't. I found the pattern - if an event starts early in the day, up until about 6:30 PM, it displays in Day view. If I change the start time to 7:30 PM, it drops off the Day view. Events do show correctly in Month view regardless of time. Our time zone is America/New York if that makes any difference.

Shai’s picture

sub

jameswoods’s picture

I discovered the same problem in #1 and independently confirmed the behavior of #2. Is this a timezone issue?

arlinsandbulte’s picture

I think this is the same issue as I reported here: #1408638: Day view not showing all events.
Marking that issue as duplicate as there seems to be some good info and activity here.
Also being reported in the Calendar module here: #1410802: Events Do not show up after 6pm
Below is the original post from that duplicate issue.

After upgrading my site to Date 6.x-2.8, I noticed that on the day view, not all events are shown. I have not found a pattern to what is shown or not shown. But, especially if there are multiple events on the day, only the first one or two will be shown in the day view.
From my experience, it only seems to affect the day view. Month view & Week views don't seem to be affected.
I verified this problem is also present in Date 6.x-2.x-dev (Last updated: January 12, 2012 - 06:06)

I traced the issue to this commit:
http://drupalcode.org/project/date.git/commit/5462b3d4c360f85e9da3ece27c...
This issue is not present before the above commit.
The issue is present with and after the above commit.

jameswoods’s picture

Awesome troubleshooting arlinsandbulte!!

stuen93’s picture

not sure if this is the same problem but I was having trouble getting any events that start after 6pm to show in the day view. I reverted to the previous version of the date module and everything starting showing up again.

thelocaltourist’s picture

Just tested with the commit released today and the problem is still there. No events with a start time after 6pm appear on the day view. Also, when creating a view with a date filter of greater than or equal to 12AM today OR greater than or equal to now events show from 6pm the previous day. It's like the time stamp is 6 hours earlier than it should be!

djhspence’s picture

I don't know if this is the same issue, but I'll link it here just in case it's related ... http://drupal.org/node/1424522

The dates appear on the calendar day view, but on the wrong day if they're after 18:00. And it only manifests when I override the default Calendar display style on the Day view with something like HTML list. When I use the stock Day view everything works as it should.

thelocaltourist’s picture

That's the same problem I'm having. To add to that, when using the calendar day view no events after 6pm/18:00 appear on the day view.

It seems that the start time for today is being set at 6pm/18:00 for the previous day and runs for 24 hours.

andywalters’s picture

sub

hejeva’s picture

thelocaltourist pointed out that this might be same issue I am seeing here:
http://drupal.org/node/1201322

The client isn't too thrilled to search for Jan 1 - Jan 31 and have to know to get around bug, to really search for Jan 2 - 31.

kfritsche’s picture

I can confirm this bug. And also can confirm that the commit mentioned by arlinsandbulte is the reason for this bug.

I changed the lines in date_api_sql (line 493) to be similar to the state before and now it works again.

  function sql_where_format($format, $field, $operator, $value, $adjustment = 0) {
    if ($adjustment === 0 && $this->local_timezone != $this->db_timezone) {
      $adjustment = NULL;
    }
    $field = $this->sql_field($field, $adjustment);
    return $this->sql_format($format, $field) ." $operator '$value'";
  }

I did not attach a Patch, because i don't know if this is the correct approch.

Maybe this should be better done in date_api_argument_handler.inc, where the adjustment is set:

  $this->offset = in_array($this->date_handler->granularity, array('hour', 'minute', 'sec')) ? NULL : 0;

But there is no db_timezone or local_timezone there, which can be checked.

sarah_g’s picture

The code in #13 worked for me.

johnshih’s picture

sub

stanb’s picture

The code in #13 seems to have worked for me also.

echoz’s picture

Status: Needs work » Needs review
StatusFileSize
new547 bytes

Works for me too, and I thought a patch would be productive towards getting it reviewed and committed if the right approach, so here is a patch of #13. Thanks kfritsche!

This file has a some trailing whitespace, which I had to leave in, as Drupal Coding Standards states to correct those separately.

Status: Active » Needs work

The last submitted patch, timezone-adjustment-1408216-17.patch, failed testing.

kfritsche’s picture

Status: Needs review » Needs work

Simpletests works fine for me locally.
Seems to me, the testbot have problems with the external dependancy jquery ui?

dwillcox’s picture

Yup, adding that patch seems to have fixed the problem for me, too. I sure hope this can get into an official release. 2.8 is a no-go as it stands.

djhspence’s picture

#13 worked for me too.

echoz’s picture

How do we get this patch to pass tests, so status can go back to "needs review"? I've noted above that it fails Drupal coding standards by having lots of trailing whitespace, but the test details indicate other things and say nothing about whitespace. I don't know much about tests, but if the whitespace corrections would fix it that would be easy. Can someone advise? Maintainer input?

karens’s picture

Ignore the failing tests on the issue queue. You do need to check that the tests don't fail if you run them locally. There are problems getting the D6 contrib tests to work right on d.o. and I've given up on that branch. The D7 tests work correctly. If there's a way to get the system to quit running tests on D6 patches I would do that, but I don't know how.

echoz’s picture

Status: Needs work » Needs review

Thanks KarenS, switching back to "needs review" then.

arlinsandbulte’s picture

izmeez’s picture

Since both competing patches (the one in this issue and the one in the other issue) appear to fix the problem are there any thoughts on which is the better way to go?

technicalknockout’s picture

Hello, I was using the patch from the other thread. The other patch basically just deleted old code in includes/date_api_argument_handler.inc:

<?php
 - // Setting the offset to avoid trying to use timezone adjustments for dates that don't need it.
 - $this->offset = in_array($this->date_handler->granularity, array('hour', 'minute', 'sec')) ? NULL : 0;
?>

I'm not sure what is gained by not doing the timezone adjustments, so I would suggest using the patch from the other thread. The patch in this thread removes the glitch, but I think allows misuse of the sql_where_format() function. I don't think there's anything wrong with the code here:

<?php
function sql_where_format($format, $field, $operator, $value, $adjustment = 0) {
     $field = $this->sql_field($field, $adjustment);
     return $this->sql_format($format, $field) ." $operator '$value'";
   }
?>

It's just not being called appropriately by the views handler. Isn't the point of having the $adjustment argument there with a default value of 0 to have the timezone adjustment logic happen before this function is called?

kentr’s picture

#17 made all my events disappear from the calendar. Reversing the patch brought them back.

Same problem with the competing patch.

Update: Turns out my events disappeared due to a schema mismatch / dirty data.

After I fixed that up, #17 resolved the original issue related to this ticket.

echoz’s picture

My issue, first described on the Calendar issue queue #1425526: 31st dates not showing on month view, is resolved by either one of these patches, #17 here, or from #8 in #1411872: Events on calendar disappear on the last day of each month near midnight. My issue also better matches #1411872: Events on calendar disappear on the last day of each month near midnight but that one was closed as a duplicate of this one.

technicalknockout’s picture

Submitting patch from http://drupal.org/node/1411872 for review.

Status: Needs review » Needs work

The last submitted patch, date-calendar-events-disappear-1408216-30.patch, failed testing.

technicalknockout’s picture

Version: 6.x-2.8 » 6.x-2.x-dev
Component: Date API » Views Argument
Status: Needs work » Needs review
StatusFileSize
new594 bytes

Looks like automated test fails because of the issue version is not the 'tip of the codebase'. Updating the issue's version and resubmitting.

echoz’s picture

@technicalknockout, note the info from KarenS the maintainer in #23 to "Ignore the failing tests on the issue queue".

terbs’s picture

Subscribing

artkon’s picture

Patch 32 worked for me , thanks.

hankvanzile’s picture

The patch in #32 fixed this problem for me, as well. using Drupal Commons 6.x-2.5.

artkon’s picture

patch 30 applied cleanly to branch 6.x-2.x

artkon’s picture

patch created for revision -> f237ddeb11f23b00f0f01ca3739971a4c3705f9f.

arlinsandbulte’s picture

StatusFileSize
new1.23 KB

Marked #772082: Date field timezone is ignored in views when used as a filter or argument without minutes granularity as a duplicate of this issue.
That issue had a bigger patch than #37/38 above, so I am attaching it here for review.
Credit should go to tangent.

tangent’s picture

My patch is bigger because I perceived the issue to exist in both filters and arguments. The patch in #38 only affects arguments. Please confirm that filters should not also be fixed before disregarding my patch. I lack the time to test or argue the case further at the moment.

technicalknockout’s picture

I agree both filters and arguments should be patched as per #39. I think the point is that not adjusting for timezones causes the date selection to miss events at the edges of the desired timespans.

terbs’s picture

I stumbled upon this issue because I was having these same symptoms. However, my problem was related to this: http://drupal.org/node/1469158

So if the patch doesn't work for you, see if that helps.

betovarg’s picture

Is this fix being considered for the next release of the module? This is indeed critical. I would wait for that answer before applying the patch if i know it is being reviewed for the future of the module.

tentonjim’s picture

Thanks for everyone's help on this.
I am building a site for my son's High School football team and freaked out when I came across this bug.

Initially the patches appeared to work... say an event the last day or last few days of March 2012, these patches fixes that issue.

I ran across another instance though... in the month of June 2012 the last date I can get to show up is Wednesday June 27th. I've dumped caches deleted recreated... am at my wit's end.

I tried every possible combination of the patches here... anyone having any luck?
Thanks a lot!
~ Jim

dwillcox’s picture

Very strange. I have no such problem on my site, though I did hand-install one of the earlier suggested patches which I don't think covered everything. I don't use a lot of bells and whistles, so it could be I'm not tripping over some other problem.

Now what would really worry me would be if you said events didn't recur after Dec. 2012. :)

andrewtf’s picture

Had the same experience (no events showing after 4 pm; previous evening's events showing in the morning in list view), applied the patch in #39 and all is well. Hope this makes it into the next module release as this issue is really a killer.

c4rl’s picture

Patch #39 works for me. Anything preventing this from RTBC?

dwillcox’s picture

Can we please get "hammas com" deleted and banned as a spammer!

dhalbert’s picture

If you see spam, post an issue at Issues for Drupal.org webmasters and it will get taken care of. I see that hammsa.com has been reported there already.

technicalknockout’s picture

Can anyone replicate #44? It may be specific to tentonjim's install. But if it's indeed related to this critical bug, then I would say this issue needs work. Otherwise let's move to 'reviewed & tested by community' as we have many reports of the patch fixing the initial issue.

nathaniel’s picture

Applied the patch in #39 and that fixed events in a view that is filtered by day and sorted by time (requires timezone conversion on the day filter).

As for #44, all events are showing up from late June and beyond.

retorque’s picture

Patch in #39 works for me, and I'm not having the problem mentioned in #44.

andrewtf’s picture

Not experiencing the issue in #44 either.

hankvanzile’s picture

Add me to the list of people not experiencing the issue in #44.

spiritcapsule’s picture

Patch in #39 appears to work for us.

technicalknockout’s picture

Status: Needs review » Reviewed & tested by the community

Marking reviewed and tested.

seaneffel’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new42.22 KB
new46.39 KB

The patch at #38 fixes the arguments issue for the original post. The patch at #39 included work on the filters.

Screenies included, notice the date of the first few results:
With #38 patch
With #39 patch

seaneffel’s picture

Status: Needs work » Reviewed & tested by the community
arlinsandbulte’s picture

Status: Reviewed & tested by the community » Fixed
arlinsandbulte’s picture

KarenS had some very relavant questions about this issue, so here is some additional info regarding the cause and history of this bug:

The commit that cused this regression was this:
http://drupalcode.org/project/date.git/commit/5462b3d4c360f85e9da3ece27c (July 28, 2011)

The original issue for that commit is:
http://drupal.org/node/1017866 (that issue is a mess, I could not make much out of it).

From this issue comments there, looks like KarenS made 2 commits for it.
http://drupal.org/node/1017866#comment-4794554 (July 28, 2011)
http://drupal.org/node/1017866#comment-5286502 (November 24, 2011)
Looks like the second Nov 24, 2011 commit was only made to the 7.x branch... maybe it should have also been applied to 6.x?
Nov 24, 2011 7.x commit: http://drupalcode.org/project/date.git/commit/f8d1ef5

jhodgdon’s picture

It would be useful to have this get into a 6.x-2.5 release. :)

arlinsandbulte’s picture

Assigned: Unassigned » arlinsandbulte
Status: Fixed » Active

jhodgdon:
Actually, this is a DATE issue, the next version of which will be 6.x-2.9 :-)

In light of my findings in #63 above, I am going to re-open this issue and assign it to myself.
I promised KarenS I would spell out the steps to reproduce this to get her discerning eyes on it and make sure the fix I applied in #62 is the right one.
I hope to get around to that later tonight.

arlinsandbulte’s picture

Assigned: arlinsandbulte » karens

KarenS: Here are steps to reproduce the issue and confirm the fix I committed in #62.

  1. Install Drupal 6.25
  2. Download CCK 6.x-2.9
  3. Download Views 6.x-2.16
  4. git clone Date 6.x-2.x into modules directory
  5. git clone Calendar 6.x-2.x into modules directory
  6. checkout broken version of date: git checkout f79ac83733854717e8bf058bc15ba58b416aa413
  7. Enable Content, Calendar, Date, Date API, Date Timezone, Date Tools, Views, & Views UI.
  8. Set default timezone to America/Chicago.
  9. Use Date Tools to create a content type, date field, & calendar view. Using all the defaults, just clicking 'save' there. (I ignored the waring about requiring the Date Repeat module for the wizard to work).
  10. Create a Date node with From date: '2012-Apr-25 / 18:30' (Leave To Date empty)
  11. Create a Date node with From date: '2012-Apr-25 / 19:30' (Leave To Date empty)
  12. Create a Date node with From date: '2012-Apr-25 / 20:30' (Leave To Date empty)
  13. Create a Date node with From date: '2012-Apr-25 / 21:30' (Leave To Date empty)
  14. Create a Date node with From date: '2012-Apr-25 / 22:30' (Leave To Date empty)
  15. Create a Date node with From date: '2012-Apr-25 / 23:30' (Leave To Date empty)
  16. Browse to /calendar-date/2012-04 (all events are displayed - good)
  17. Browse to /calendar-date/2012-W17 (all events are displayed - good)
  18. Browse to /calendar-date/2012-04-25 (ONY the first event '2012-Apr-25 / 18:30' is displayed - BAD)
  19. git checkout -dev version of date 6.x-2.x (this has the patch from #62 applied).
  20. Reload /calendar-date/2012-04-25 (all events are displayed - the patch works!)
  21. The other calendar views work too.
karens’s picture

OK, I can replicate the issue. The commit made by Arlin is correct. The second patch I made to the D7 version made the same changes but also had some additional changes. I need to look at the rest of those changes to see which ones are applicable to D6 and get them in.

Great detective work Arlin! Thanks so much.

The dev version has the fix for this issue. Once I sort the rest of this out and do a little more issue clean up I'll get a new release out.

karens’s picture

Status: Active » Fixed

I sorted out the rest of this. Dev should now have all the right fixes.

http://drupalcode.org/project/date.git/commit/82d04ee

arlinsandbulte’s picture

Status: Fixed » Active

Ugh:
After the commit in #62, the issue was fixed.
After the commit in #68, the issue is back...

karens’s picture

Status: Active » Fixed
arlinsandbulte’s picture

Assigned: karens » Unassigned

THAT WAS IT!
Everything works great for me now.

Thanks KarenS!

kentr’s picture

Good news!

Is it in the D6 branch yet?

Hmm, according to http://drupalcode.org/project/date.git/commitdiff/82d04ee, looks like it is in D6.

c4rl’s picture

This issue was never tagged as 7.x, so it's always been 6.x AFAIK.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.