5

In one of our environments (doesn't happen locally) we are seeing the following error in the experience editor.

enter image description here

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?

  • can you try to remove renderings one by one ? I think is a problem on one of your renderings – Vlad Iobagiu Sep 5 '18 at 8:37
  • Check the renderings and their placeholder keys on the page if they're correct or not. Similar issue can be found at blog.nikkipunjabi.com/2017/06/… – Waqar Haider Sep 5 '18 at 9:39
  • If I remove a component, it does go away. However, there doesn't appear to be anything wrong with the component, it was added via the experience editor and it displays fine. One thing I have noticed is that this only happens in FireFox and not Chrome. There are a bunch of console errors such as TypeError: nav is null from Ribbon.aspx in Sitecore – David Masters Sep 5 '18 at 10:31
  • 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. – David Masters Sep 6 '18 at 9:40
  • EnforceVersionPresence and Language Fallback settings the same, across environments? – Mark Cassidy Sep 6 '18 at 9:52
5

TLDR

You have data source items that contain broken links.

Long explanation:

This error message occurs in the experience editor under the following conditions:

  1. Your item is in the final workflow stage.
  2. You have renderings that are pointing to data source items that don't exist.
  3. You have the "Associated Content" checkbox checked in the "View" tab in the ribbon.

When these conditions are true, and XHR is sent to http://host/-/speak/request/v1/expeditor/ExperienceEditor.Workflow.AreItemsInFinalWorkflowState where the payload contains the following (note the undefined):

"value": "{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},undefined

This causes an exception in Sitecore.ExperienceEditor.Speak.Ribbon.Requests.Workflow.AreItemsInFinalWorkflowState because it is trying to parse a version number from the undefined string. This results in a null argument being passed to Database.GetItem(). The error is returned to the front end and displayed on the page prevent the page from being published.

Once you fix the links in the datasource items, the data than gets sent is:

"value": "{4A5BB80B-BE5E-4C56-9442-FD3C3840E1FA},1

...where 1 is the version number.

Although an error message is useful when there are broken links, I think this is probably a bug in Sitecore as the error message is unrelated and unhelpful.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.