From 59d8688f811e893d12c6090d7fe29f0383a6db6e Mon Sep 17 00:00:00 2001 From: Yannick Trinh Date: Fri, 13 Dec 2024 17:25:47 +0100 Subject: [PATCH] GitHub:11728 (fix issue #12251) --- Project/Sources/Classes/Office365Calendar.4dm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Project/Sources/Classes/Office365Calendar.4dm b/Project/Sources/Classes/Office365Calendar.4dm index 9fed777..358c72a 100644 --- a/Project/Sources/Classes/Office365Calendar.4dm +++ b/Project/Sources/Classes/Office365Calendar.4dm @@ -15,7 +15,7 @@ Class constructor($inProvider : cs.OAuth2Provider; $inParameters : Object) Function _getURLParamsFromObject($inParameters : Object; $inCount : Boolean) : Text var $URL : Text:=Super._getURLParamsFromObject($inParameters; $inCount) - var $delimiter : Text:=(Position("&";$URL)>0) ? "&" : "?" + var $delimiter : Text:=(Position("&"; $URL)>0) ? "&" : "?" If (Length(String($inParameters.startDateTime))>0) $URL+=$delimiter+"startDateTime="+cs.Tools.me.urlEncode(inParameters.startDateTime) @@ -25,7 +25,7 @@ Function _getURLParamsFromObject($inParameters : Object; $inCount : Boolean) : T $URL+=$delimiter+"endDateTime="+cs.Tools.me.urlEncode(inParameters.endDateTime) $delimiter:="&" End if - + return $result @@ -182,7 +182,7 @@ Function getEvents($inParameters : Object) : Object Else $urlParams+="me" End if - If (Length(String($inParameters.calendarId))>0) + If ((Value type($inParameters.calendarId)=Is text) && (Length(String($inParameters.calendarId))>0)) $urlParams+="/calendars/"+$inParameters.calendarId Else $urlParams+="/calendar" @@ -190,10 +190,10 @@ Function getEvents($inParameters : Object) : Object $urlParams+="/events"+This._getURLParamsFromObject($inParameters) var $prefer : Text:="" - If (Length(String($inParameters.timeZone))>0) + If ((Value type($inParameters.timeZone)=Is text) && (Length(String($inParameters.timeZone))>0)) $prefer+="outlook.timezone="+$inParameters.timeZone End if - If (Length(String($inParameters.bodyContentType))>0) + If ((Value type($inParameters.bodyContentType)=Is text) && (Length(String($inParameters.bodyContentType))>0)) $prefer+=((Length($prefer)>0) ? "; " : "")+"outlook.body-content-type="+$inParameters.bodyContentType+" " End if If (Length($prefer)>0)