[Zope-CMF] CMFCalendar issue

Tres Seaver tseaver@zope.com
15 Oct 2002 16:11:51 -0400


--=-PxYDDz9xyu91YoFUqv1s
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Tue, 2002-10-15 at 15:53, Eric Dunn wrote:
> I've created a ZOPE 2.5.1 site with CMF 1.3.
> After deplyment to Production it was discovered that
> CMF Events do not show in the presentation layer of
> the Calendar on the last day of each month.
> Example:  Events posted in the CMF will show in the
> CMFCalendar for everyday except the last day (31
> Oct.).
> Tried all obvious operations with no success
> (security, publishing, ect...)

Could it be related to caching?  I just created an event on the dogbowl
for 10/31/2002, and it is showing up:

  http://cmf.zope.org

(You may need to force a cache refresh).

> Anyone know if this is a known bug?

I do know we fixed a bug after 1.3 where the wrong field was being
used to filter the catalog ('Type' instead of 'portal_type');  could
that be in play, here?  I am attaching a patch you could try, if that
is the case.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com

--=-PxYDDz9xyu91YoFUqv1s
Content-Disposition: attachment; filename=CalendarTool.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=CalendarTool.patch; charset=ISO-8859-1

Index: CMFCalendar/CalendarTool.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs-repository/CMF/CMFCalendar/CalendarTool.py,v
retrieving revision 1.1.6.2
retrieving revision 1.1.6.3
diff -u -r1.1.6.2 -r1.1.6.3
--- CMFCalendar/CalendarTool.py	2 Aug 2002 17:21:38 -0000	1.1.6.2
+++ CMFCalendar/CalendarTool.py	6 Oct 2002 16:34:07 -0000	1.1.6.3
@@ -127,9 +127,12 @@
         """ given a year and month return a list of days that have events =
"""
         first_date=3DDateTime(str(month)+'/1/'+str(year))
         last_day=3Dcalendar.monthrange(year, month)[1]
-        last_date=3DDateTime(str(month)+'/'+str(last_day)+'/'+str(year))
-   =20
-        query=3Dself.portal_catalog(Type=3Dself.calendar_types,
+        ## This line was cropping the last day of the month out of the
+        ## calendar when doing the query
+	## last_date=3DDateTime(str(month)+'/'+str(last_day)+'/'+str(year))
+	last_date=3Dfirst_date + last_day   =20
+       =20
+	query=3Dself.portal_catalog(portal_type=3Dself.calendar_types,
                                   review_state=3D'published',	            =
             =20
                                   start=3D(first_date, last_date),
                                   start_usage=3D'range:min:max',
@@ -142,7 +145,7 @@
         # but I don't know how to do that in one search query :(  - AD
=20
         # if you look at calendar_slot you can see how to do this in 1 que=
ry - runyaga
-        query+=3Dself.portal_catalog(Type=3Dself.calendar_types,
+        query+=3Dself.portal_catalog(portal_type=3Dself.calendar_types,
                                    review_state=3D'published',
                                    end=3D(first_date, last_date),
                                    end_usage=3D'range:min:max',
@@ -208,19 +211,19 @@
         #last_date=3DDateTime(thisDay.Date()+" 23:59:59")
=20
         # Get all events that Start on this day
-        query=3Dself.portal_catalog(Type=3Dself.calendar_types,
+        query=3Dself.portal_catalog(portal_type=3Dself.calendar_types,
                                   review_state=3D'published',	            =
             =20
                                   start=3D(first_date,last_date),
                                   start_usage=3D'range:min:max')
        =20
         # Get all events that End on this day
-        query+=3Dself.portal_catalog(Type=3Dself.calendar_types,
+        query+=3Dself.portal_catalog(portal_type=3Dself.calendar_types,
                                   review_state=3D'published',	            =
             =20
                                   end=3D(first_date,last_date),
                                   end_usage=3D'range:min:max')
=20
         # Get all events that Start before this day AND End after this day
-        query+=3Dself.portal_catalog(Type=3Dself.calendar_types,
+        query+=3Dself.portal_catalog(portal_type=3Dself.calendar_types,
                                   review_state=3D'published',
                                   start=3Dfirst_date,
                                   start_usage=3D'range:max',

--=-PxYDDz9xyu91YoFUqv1s--