In one of our environments (doesn't happen locally) we are seeing the following error in the experience editor.
The error only appears once the item has been approved in workflow.
The stack trace from the logs is:
2840 09:12:27 ERROR Value cannot be null.
Parameter name: version
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: version
Source: Sitecore.Kernel
at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
at Sitecore.Data.DefaultDatabase.GetItem(ID itemId, Language language, Version version)
at Sitecore.ExperienceEditor.Speak.Ribbon.Requests.Workflow.AreItemsInFinalWorkflowState.GetItemsFromRequestValue()
at Sitecore.ExperienceEditor.Speak.Ribbon.Requests.Workflow.AreItemsInFinalWorkflowState.ProcessRequest()
at Sitecore.ExperienceEditor.Speak.Server.Requests.PipelineProcessorRequest`1.Process(RequestArgs requestArgs)
Sitecore version: 8.2 update 2
Update:
It appears to occur when a datasource item has a broken link. If I fix the links the error disappears. However, what's confusing is that we are getting this error in our QA environment but not in our production, even though it has the same data, which suggests it is something we have introduced from code.
Update 2:
To make things even more curious, I see the error when logged in as the Admin account, however, if I login as a different user (who also has the Administrator checkbox checked) the error doesn't display!
Update 3
The difference between the two users & environments was simply down to preferences, whereby one user had the "Associated content" checkbox selected within the View tab of the Ribbon. Having this selected on an item in the approved workflow state seems to determine whether or not an XHR request is made to:
http://host/-/speak/request/v1/expeditor/ExperienceEditor.Workflow.AreItemsInFinalWorkflowState
And this request is producing the error which gets displayed in red. The request contains the following payload:
{
"language": "en",
"version": 1,
"isFallback": false,
"isHome": false,
"itemId": "{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}",
"database": "master",
"deviceId": "{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}",
"isLocked": false,
"isLockedByCurrentUser": false,
"ribbonUrl": "/?sc_mode=edit&sc_itemid={110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}&sc_version=1&sc_lang=en&sc_site=presales",
"siteName": "presales",
"isReadOnly": false,
"analyticsEnabled": true,
"webEditMode": "edit",
"requireLockBeforeEdit": false,
"virtualFolder": "/",
"isInFinalWorkFlow": true,
"argument": "",
"value": "{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{6C522CA2-7C32-4BC2-842C-73D7FDFDF0F4},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{A924615B-7B4E-443F-9373-022754F2F912},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{5B0C5A66-762B-48A0-9091-C49CCACD5FDD},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{7AC76F5C-41C3-464F-80CF-4AF1828582E3},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined|{0AF18751-B2DB-42E9-A3AC-AC6676FBE59C},undefined"
}
After de-compiling the Sitecore.ExperienceEditor.Speak.Ribbon.Requests.Workflow.AreItemsInFinalWorkflowState
type, I can see the code is trying to parse a version number from each instance of 'undefined' in the value property of the payload. This results in null being sent to Database.GetItem(id, lang, version) and then the exception.
So the question now is, why are these values undefined?
TypeError: nav is null
from Ribbon.aspx in Sitecore