This project has moved and is read-only. For the latest updates, please go here.
1
Vote

SP2013 enrol in course error - due to UTC DATE TIME

description

I'm working on a SharePoint+SLK implementation within AUSTRALIA - and was finding that there's an error within a FUNCTION for the new SP2013 set (v1.7)

We were finding that users could click on a course, but would see the error message :
The assignment (ID {0}) does not exist or you may not have permission to access it.

Furthermore, this error was ONLY happening 'in the morning' on our environment !!

Explanation :
Within the function "LearnerAssignmentListForLearners" (SQL), there is a WHERE clause :
WHERE lui.[Key] = @UserKey
AND GETUTCDATE() >= asi.StartDate
The data rows are added to 'AssignmentItem' as :
16/10/2014 00:00:00

But - the UTC date was resolving as :
15/10/2014 22:35:00 (yesterday)

And so - ZERO rows were returned - and the error above occurred.
After a few hours (~11am) the UTC date ticked along - and it all worked !
16/10/2014 00:05:00 (today)

We have changed this FUNCTION to :
WHERE lui.[Key] = @UserKey
AND GETDATE() >= asi.StartDate
NOTE :
  • GETUTCDATE() changed to GETDATE()
===============

Can you include this change in the base version of the update (SP2013) ??

Hopefully this doesn't impact other people - perhaps only IN AUSTRALIA !??!

file attachments

comments

mitchjhill wrote Nov 19, 2014 at 1:25 AM

I've run into the same issue in a SharePoint 2010 environment. Our environment is in New Zealand (currently UTC+13 due to Daylight Savings).

Also note that the Scalar-valued function "dbo.AssignmentPropertiesView$Security" also appears to use GETUTCDATE() instead of GETDATE(). This should probably be updated as well.

hobbes29 wrote Nov 27, 2014 at 11:00 PM

Hi Richard

Can you please advise if this bug has been fixed in v1.7.1?

Thanks
Adrian

RichardWillis wrote Feb 27, 2015 at 4:37 PM

The dates stored in the database should be UTC dates, so should be comparing against GETUTCDATE(). Can you check to see if the dates are local or UTC in the DB.

Can you try an install of 1.8 and see if that's the same or not please.

SviatoslavB wrote Dec 21, 2016 at 3:46 PM

Hello everyone,
I'm facing the same issue on SLK version 1.8.

After assignment is created in DB we are trying to launch it. Below error appears:
SharePoint Learning Kit Error

Microsoft.SharePointLearningKit.SafeToDisplayException: The assignment (ID (7bf013e4-0913-45eb-b175-8f6a8e62ee86) does not exist or you may not have permission to access it.
   at Microsoft.SharePointLearningKit.SlkStore.LoadLearnerAssignment(LearningStoreQuery query, Boolean checkSingular, Object assignmentId)
   at Microsoft.SharePointLearningKit.SlkStore.LoadAssignmentPropertiesForLearner(Guid learnerAssignmentGuidId, SlkRole slkRole)
   at Microsoft.SharePointLearningKit.Frameset.FramesetPage.GetLearnerAssignment(Boolean forceUpdate)
   at Microsoft.SharePointLearningKit.Frameset.FramesetCode.TryGetAttemptId(Boolean showErrorPage, AttemptItemIdentifier& attemptId)
   at Microsoft.LearningComponents.Frameset.FramesetHelper.ProcessPageLoad(PackageStore packageStore, TryGetViewInfo TryGetViewInfo, TryGetAttemptInfo TryGetAttemptInfo, ProcessViewRequest ProcessViewRequest)
   at Microsoft.SharePointLearningKit.Frameset.FramesetCode.<Page_Load>b__3()
   at Microsoft.SharePointLearningKit.SlkUtilities.RetryOnDeadlock(VoidDelegate del)
   at Microsoft.SharePointLearningKit.Frameset.FramesetCode.Page_Load(Object sender, EventArgs e)
I'm in UTC+10 timezone, and you may see the difference between DateCreated and StartDate in the DB (screen attached). I suppose that those dates should be identical.

Please advise.

SviatoslavB wrote Dec 21, 2016 at 3:49 PM

Sorry, here is the image:
Image