From be36e0ceea2e2a9c6aa1099a7d854a65a7b75765 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 21 Feb 2014 20:35:54 -0500 Subject: [PATCH] Fix view changes in calendar module Fixes #2613 --- NEWS | 4 +++- UI/WebServerResources/SchedulerUI.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index a9e6fb41c..e30028e73 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ------------------ New features + - initial implementation of Microsoft ActiveSync protocol - it's now possible to set a default reminder for calendar components using SOGoCalendarDefaultReminder - select multiple files to attach to a message or drag'n'drop files onto the @@ -12,7 +13,7 @@ New features Enhancements - we now automatically convert into file attachments - using CIDs. This prevents Outlook issues. + using CIDs to prevent Outlook issues - updated French and Finnish translations - XMLHttpRequest.js is now loaded conditionaly (< IE9) - format time in attendees invitation window according to the user's locale @@ -48,6 +49,7 @@ Bug fixes - replace slashes by dashes in filenames of attachments to avoid a 404 return code (#2537) - avoid over-using LDAP connections when decomposing groups - fixed display of a contact's birthday when not defined (#2503) + - fixed JavaScript error when switching views in calendar module (#2613) 2.1.1b (2013-12-04) ------------------- diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 98449b327..5efecbd57 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -2526,7 +2526,7 @@ function restoreSelectedDay() { selectedDayDate = findDateFromDayNumber(selectedDayNumber); else selectedDayDate = currentDay; - if (selectedDayDate.length > 0) + if (selectedDayDate && selectedDayDate.length > 0) day = $("day" + selectedDayDate); } if (day) { @@ -2542,7 +2542,7 @@ function findDateFromDayNumber(dayNumber) { else view = $("daysView"); var days = view.select(".day"); - return days[dayNumber].readAttribute("day"); + return (dayNumber < days.size()) ? days[dayNumber].readAttribute("day") : null; } function onShowCompletedTasks(event) {