0

Let there be a bucket with the structure: Parent/a/b/c/abc item name, and the bucket from layer 3, which contains 295 items.

Let there be an item with a field of type "General Link with Search". When I click insert link and navigate to "abc item name" from above, the Insert Link modal is not extending the 3rd layer bucket, thus I cannot see items from it.

If I navigate to the same bucket from the Content Editor, it loads all the 295 items.

Is there any setting or limitation I am not aware of?

Thanks

Insert link Modal buckets

Content editor buckets

4
  • Can you see any errors in logs? Sep 6 at 15:08
  • @SwatiGupta, yes, Message: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. In the web.config the value is 2147483646 and even if I increase it to an absurd value like 1112147483646, the result is the same.
    – iusmar
    Sep 6 at 16:09
  • What is your Sitecore version? Sep 6 at 17:01
  • My Sitecore version is 9.2
    – iusmar
    Sep 6 at 18:21
1

You can try to override Sitecore.ItemWebApi.Pipelines.Request.SerializeResponse, Sitecore.ItemWebApi' this pipeline.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">  
      <sitecore>  
          <pipelines>  
              <itemWebApiRequest>  
                <processor patch:instead="*[@type='Sitecore.ItemWebApi.Pipelines.Request.SerializeResponse, Sitecore.ItemWebApi']" type="Sitecore.SharedSource.ItemWebApiCustom.Override.SerializeResponseOverride, Sitecore.SharedSource.ItemWebApiCustom" />   
              </itemWebApiRequest>  
           </pipelines>  
      </sitecore>  
 </configuration>  
using System;  
 using System.Web.Script.Serialization;  
 using Newtonsoft.Json;  
 using Sitecore.Diagnostics;  
 using Sitecore.ItemWebApi.Serialization;  
 using Formatting = System.Xml.Formatting;  
 namespace Sitecore.SharedSource.ItemWebApiCustom.Override  
 {  
   public class SerializerOverride : ISerializer  
   {  
     public string Serialize(object value)  
     {  
       Assert.ArgumentNotNull(value, "value");  
       var serializer = new JavaScriptSerializer {MaxJsonLength = Int32.MaxValue};  
       dynamic parsedJson = JsonConvert.DeserializeObject(serializer.Serialize(value));  
       return JsonConvert.SerializeObject(parsedJson, (Newtonsoft.Json.Formatting) Formatting.Indented);  
     }  
     public string SerializedDataMediaType => "application/json";  
   }  
 }  
 using Sitecore.Diagnostics;  
 using Sitecore.ItemWebApi.Pipelines.Request;  
 namespace Sitecore.SharedSource.ItemWebApiCustom.Override  
 {  
   public class SerializeResponseOverride : SerializeResponse  
   {  
     public override void Process(RequestArgs arguments)  
     {  
       Assert.ArgumentNotNull(arguments, "arguments");  
       SerializerOverride serializer = new SerializerOverride();  
       arguments.ResponseText = serializer.Serialize(arguments.Result);  
     }  
   }  
 }  
2
  • Ty for the input. I'll try it tomorrow and will let you know about the results.
    – iusmar
    Sep 6 at 18:21
  • It worked. Thank you!
    – iusmar
    Sep 7 at 14:18

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.