[Checkins] SVN: CMF/branches/1.5/C - A re-used variable name led to rendering errors in some cases

Jens Vagelpohl jens at dataflake.org
Tue Mar 28 11:57:39 EST 2006


Log message for revision 66244:
  - A re-used variable name led to rendering errors in some cases
    (http://www.zope.org/Collectors/CMF/411)
  

Changed:
  U   CMF/branches/1.5/CHANGES.txt
  U   CMF/branches/1.5/CMFCalendar/CalendarTool.py
  U   CMF/branches/1.5/CMFCalendar/tests/test_Calendar.py

-=-
Modified: CMF/branches/1.5/CHANGES.txt
===================================================================
--- CMF/branches/1.5/CHANGES.txt	2006-03-28 16:33:06 UTC (rev 66243)
+++ CMF/branches/1.5/CHANGES.txt	2006-03-28 16:57:38 UTC (rev 66244)
@@ -2,6 +2,9 @@
 
   Bug Fixes
 
+    - A re-used variable name led to rendering errors in some cases
+      (http://www.zope.org/Collectors/CMF/411)
+
     - The line-endings problem fixed for file-based PythonScripts applies to
       multi-line python code in file-based PageTemplates as well. The same
       fix (universal line-endings support) is now used here too.

Modified: CMF/branches/1.5/CMFCalendar/CalendarTool.py
===================================================================
--- CMF/branches/1.5/CMFCalendar/CalendarTool.py	2006-03-28 16:33:06 UTC (rev 66243)
+++ CMF/branches/1.5/CMFCalendar/CalendarTool.py	2006-03-28 16:57:38 UTC (rev 66244)
@@ -190,8 +190,8 @@
                     eventDays[eventday]['event'] = 1
 
                 if result.end == result.end.earliestTime():
-                    last_day = eventDays[allEventDays[-2]]
-                    last_days_event = last_day['eventslist'][-1]
+                    last_day_data = eventDays[allEventDays[-2]]
+                    last_days_event = last_day_data['eventslist'][-1]
                     last_days_event['end'] = (result.end-1).latestTime().Time()
                 else:
                     eventDays[eventEndDay]['eventslist'].append( {'end':

Modified: CMF/branches/1.5/CMFCalendar/tests/test_Calendar.py
===================================================================
--- CMF/branches/1.5/CMFCalendar/tests/test_Calendar.py	2006-03-28 16:33:06 UTC (rev 66243)
+++ CMF/branches/1.5/CMFCalendar/tests/test_Calendar.py	2006-03-28 16:57:38 UTC (rev 66244)
@@ -274,6 +274,54 @@
         result = self.Tool.getEventsForCalendar(month='5', year='2002')
         self.assertEqual(result, data)
 
+    def test_eventCalendarRenderingIssue411(self):
+        #  http://www.zope.org/Collectors/CMF/411
+        self.Site.Members.invokeFactory(type_name="Event",id='Event1')
+        event = self.app.restrictedTraverse('/CalendarTest/Members/Event1')
+        event.edit( title='title'
+                    , description='description'
+                    , eventType=( 'eventType', )
+                    , effectiveDay=31
+                    , effectiveMo=3
+                    , effectiveYear=2006
+                    , expirationDay=1
+                    , expirationMo=4
+                    , expirationYear=2006
+                    , start_time="00:00"
+                    , startAMPM="AM"
+                    , stop_time="00:00"
+                    , stopAMPM="AM"
+                    )
+        self.Site.portal_workflow.doActionFor(
+                                              event,
+                                              'publish',
+                                              comment='testing')
+
+        self.Site.Members.invokeFactory(type_name="Event",id='Event2')
+        event = self.app.restrictedTraverse('/CalendarTest/Members/Event2')
+        event.edit( title='title'
+                    , description='description'
+                    , eventType=( 'eventType', )
+                    , effectiveDay=29
+                    , effectiveMo=3
+                    , effectiveYear=2006
+                    , expirationDay=30
+                    , expirationMo=3
+                    , expirationYear=2006
+                    , start_time="00:00"
+                    , startAMPM="AM"
+                    , stop_time="00:00"
+                    , stopAMPM="AM"
+                    )
+        self.Site.portal_workflow.doActionFor(
+                                              event,
+                                              'publish',
+                                              comment='testing')
+
+        # With the bug unfixed, this raises a TypeError
+        ignored = self.Site.portal_calendar.catalog_getevents(2006, 3)
+
+
     def test_spanningEventCalendarRendering(self):
 
         self.Site.Members.invokeFactory(type_name="Event",id='Event1')



More information about the Checkins mailing list