Could not update content sort order?

I have an issues where I’m not able to sort children of a specific type.
I can easily sort other doctypes, except this one.

Any suggestions on how to debug this ?

When I try I get the following error:

Newtonsoft.Json.JsonReaderException: Error parsing undefined value. Path '', line 1, position 1.
   at Newtonsoft.Json.JsonTextReader.ParseUndefined()
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Umbraco.Cms.Core.PropertyEditors.MultiUrlPickerValueEditor.GetReferences(Object value)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at Umbraco.Cms.Core.PropertyEditors.DataValueReferenceFactoryCollection.GetReferencesEnumerable(IDataEditor dataEditor, IEnumerable`1 values)+MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at Umbraco.Cms.Core.PropertyEditors.DataValueReferenceFactoryCollection.GetAllReferences(IPropertyCollection properties, PropertyEditorCollection propertyEditors)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.ContentRepositoryBase`3.PersistRelations(TEntity entity)
   at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.DocumentRepository.PersistUpdatedItem(IContent entity)
   at Umbraco.Cms.Core.Cache.DefaultRepositoryCachePolicy`2.Update(TEntity entity, Action`1 persistUpdated)
   at Umbraco.Cms.Core.Services.ContentService.Sort(ICoreScope scope, IContent[] itemsA, Int32 userId, EventMessages eventMessages)
   at Umbraco.Cms.Core.Services.ContentService.Sort(IEnumerable`1 ids, Int32 userId)
   at Umbraco.Cms.Web.BackOffice.Controllers.ContentController.PostSort(ContentSortOrder sorted)

Looks like one of the content items you are trying to sort has a multiurlpicker with an invalid value saved in it.

You could go through them and ensure they have valid selections and then republish them.

It is likely this line that fails:
Umbraco-CMS/src/Umbraco.Infrastructure/PropertyEditors/MultiUrlPickerValueEditor.cs at contrib · umbraco/Umbraco-CMS

You could also set a breakpoint there and see what value it fails on, then probably find the node by moving up the call stack.

1 Like

You’re absolutely right. Thank you.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.