Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tomas Kamensky 6 posts 76 karma points
    Oct 20, 2020 @ 13:57
    Tomas Kamensky
    0

    Error Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: L. Path '', line 0, position 0.

    Hi, I got this error. I use one document type on 5 pages - different blogs sections. Only on one of these have error. Same error is in backoffice when I try open one of articles in that blog section. Log says:

    Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: L. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() in //Src/Newtonsoft.Json/JsonTextReader.cs:line 1706 at Newtonsoft.Json.JsonTextReader.Read() in //Src/Newtonsoft.Json/JsonTextReader.cs:line 419 at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) in //Src/Newtonsoft.Json/JsonReader.cs:line 1195 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) in //Src/Newtonsoft.Json/Serialization/JsonSerializerInternalReader.cs:line 196 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) in //Src/Newtonsoft.Json/JsonSerializer.cs:line 907 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) in //Src/Newtonsoft.Json/JsonConvert.cs:line 828 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) in //Src/Newtonsoft.Json/JsonConvert.cs:line 786 at Umbraco.Web.PropertyEditors.MultipleValueEditor.ToEditor(Property property, IDataTypeService dataTypeService, String culture, String segment) in D:\a\1\s\src\Umbraco.Web\PropertyEditors\MultipleValueEditor.cs:line 38 at Umbraco.Web.Models.Mapping.ContentPropertyBasicMapper1.Map(Property property, TDestination dest, MapperContext context) in D:\a\1\s\src\Umbraco.Web\Models\Mapping\ContentPropertyBasicMapper.cs:line 79 at Umbraco.Web.Models.Mapping.ContentPropertyDisplayMapper.Map(Property originalProp, ContentPropertyDisplay dest, MapperContext context) in D:\a\1\s\src\Umbraco.Web\Models\Mapping\ContentPropertyDisplayMapper.cs:line 24 at Umbraco.Web.Models.Mapping.ContentPropertyMapDefinition.Map(Property source, ContentPropertyDisplay target, MapperContext context) in D:\a\1\s\src\Umbraco.Web\Models\Mapping\ContentPropertyMapDefinition.cs:line 58 at Umbraco.Core.Mapping.UmbracoMapper.<>c__DisplayClass8_02.02.<Define>b__1(Object source, Object target, MapperContext context) in D:\a\1\s\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 106 at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context) in D:\a\1\s\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 206 at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, MapperContext context) in D:\a\1\s\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 154 at Umbraco.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Action1 f) in D:\a\1\s\src\Umbraco.Core\Mapping\UmbracoMapper.cs:line 143 at Umbraco.Web.Editors.ContentController.MapToDisplay(IContent content) in D:\a\1\s\src\Umbraco.Web\Editors\ContentController.cs:line 2175 at Umbraco.Web.Editors.ContentController.GetById(Int32 id) in D:\a\1\s\src\Umbraco.Web\Editors\ContentController.cs:line 299 at lambdamethod(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>cDisplayClass62.

    Can anyone help? Thanks

  • Anzal 11 posts 81 karma points
    Oct 21, 2020 @ 06:20
    Anzal
    0

    Hi, Maybe you changed an existing data type for a field in the document type, so if you view the content node of that document type say blog page you may get that error. Better to remove that changed field and save the document type and check if the error is gone. Then create once again the same field with a different alias name. Hop that will work.

  • Tomas Kamensky 6 posts 76 karma points
    Oct 21, 2020 @ 07:18
    Tomas Kamensky
    0

    Hi thanks for answer. Any data wasn´t change. I was thinking about delete that article too. But I am curious where is error, so if we can find it, it will not repeat error in future (I hope so...)

  • Anzal 11 posts 81 karma points
    Oct 21, 2020 @ 07:33
    Anzal
    0

    HI, Were you trying to create the articles(content node) programmatically? If some wrong data is added to fields via code, there might be an error like this when viewing that node from backoffice.

  • Tomas Kamensky 6 posts 76 karma points
    Oct 21, 2020 @ 08:12
    Tomas Kamensky
    0

    No... All of articles were created by person. But only one article gets error

  • Anzal 11 posts 81 karma points
    Oct 21, 2020 @ 08:49
    Anzal
    0

    Could you share any screenshot of any article and its document type to get a better idea? And could you let me know what was the last change made to that error occurred article, I mean to which field?

  • Naty 14 posts 81 karma points
    Aug 03, 2021 @ 22:00
    Naty
    0

    Hi' Tomas

    Did you get the solution?

  • Tomas Kamensky 6 posts 76 karma points
    Aug 04, 2021 @ 08:10
    Tomas Kamensky
    0

    Hi Naty,

    Unfortunately, no. I deleted the article and created it again. Then it worked without problems

  • Bishwajit 28 posts 98 karma points
    Aug 03, 2023 @ 09:22
    Bishwajit
    0

    I am facing same issue while save and publish. Can someone help on this. How can I debug or find out for which exact data its failing ? enter image description here

    I am using below code for save and publish.

    public class WebApiHandler : DelegatingHandler
    {
        protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
        {
            if (request.RequestUri.AbsolutePath.ToLower() == "/umbraco/backoffice/umbracoapi/content/postsave")
            {
                return base.SendAsync(request, cancellationToken)
                    .ContinueWith(task =>
                    {
                        var response = task.Result;
                        try
                        {
                            var data = response.Content;
                            var content = ((ObjectContent)(data)).Value as ContentItemDisplay;
                            if ((bool)content?.ContentTypeAlias?.Equals(DocTypes.RBStarterKitCampaignPage.Alias))
                            {
                                //there is already a campaign page so publishing has been cancelled
                                if (content.Notifications.Count > 0)
                                {
                                    foreach (var notification in content.Notifications)
                                    {
                                        if (notification.Header.Equals("Publish") && notification.Message.ToLower().Contains("publishing was cancelled"))
                                        {
                                            var campaignMaxCountPerMarket =  ConfigurationManager.AppSettings.Get(AppSettingKeys.CampaignMaxCountPerMarket);
    
                                            var message = ResxMessages.Get(ResxMessages.BackOffice_MultipleCampaignPage_Error);
                                            var parts = message.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                                            //change the default notification to our custom message
                                            notification.Header = (parts.Length > 1) ? parts[0] : "Publish";
                                            notification.Message = (parts.Length > 1) ? string.Format(parts[1], campaignMaxCountPerMarket) : string.Format(message, campaignMaxCountPerMarket);
                                          //  notification.NotificationType = SpeechBubbleIcon.Warning;
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            Current.Logger.Error<WebApiHandler>("Error changing custom publishing cancelled message.", ex);
                        }
                        return response;
                    }, cancellationToken);
            }
    
            return base.SendAsync(request, cancellationToken);
        }
    }
    

    Great thanks !

Please Sign in or register to post replies

Write your reply to:

Draft