Skip to content

Commit 8613004

Browse files
Workarounded issue #423453
1 parent 3eccf67 commit 8613004

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
-61.5 KB
Binary file not shown.

src/Sitecore.Support.AdvancedSearchList/sitecore/shell/Applications/Dialogs/ASL/ParamsStorage/UrlHandleStorage.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace Sitecore.Support.ASL.ParamsStorage
33
{
44
using System;
55
using System.Collections.Specialized;
6+
using System.Reflection;
67
using System.Web;
78
using Sitecore.Diagnostics;
89
using Sitecore.Text;
@@ -22,7 +23,10 @@ protected UrlHandleStorage(UrlHandle handle)
2223

2324
public void Flush(ref UrlString url)
2425
{
25-
this.handle.Add(url, UrlHandleStorage.HandleName);
26+
Assert.ArgumentNotNull(url, "urlString");
27+
// To workaround issue 423453:
28+
// this.handle.Add(url, UrlHandleStorage.HandleName);
29+
this.handle.AddFixed(url, UrlHandleStorage.HandleName);
2630
}
2731

2832
public void Clear()
@@ -80,4 +84,27 @@ private static string ExtractHandleId(HttpRequest r)
8084
return string.IsNullOrWhiteSpace(handleValue) ? null : handleValue;
8185
}
8286
}
87+
88+
// To workaround issue 423453 in the line:
89+
internal static class Issue423453
90+
{
91+
private static readonly FieldInfo fiValues;
92+
93+
static Issue423453()
94+
{
95+
fiValues = typeof(Sitecore.Web.UrlHandle).GetField("_values", BindingFlags.Instance | BindingFlags.NonPublic);
96+
}
97+
98+
public static void AddFixed(this UrlHandle handle, UrlString urlString, string handleName)
99+
{
100+
Assert.ArgumentNotNull(handle, "handle");
101+
Assert.ArgumentNotNull(urlString, "urlString");
102+
Assert.ArgumentNotNullOrEmpty(handleName, "handleName");
103+
104+
var values = fiValues.GetValue(handle) as NameValueCollection;
105+
var str = new UrlString(values);
106+
urlString[handleName] = handle.Handle;
107+
WebUtil.SetSessionValue(handle.Handle, str.ToString());
108+
}
109+
}
83110
}

0 commit comments

Comments
 (0)