This project is read-only.
4
Vote

JsonReaderException: Invalid property identifier character: {. Path '', line 1, position 1.]

description

From time to time, I have a very strange issue: Image Multipicker fields render incorrectly in Editor mode, see Attachement screenshot.

The solution for me was always to re-install the Image Powertools module...
Today, this Workaround did not work for me.

In the ContentItem_VersionRecord, there was the entry

<Data><Page><Bilder Data="{{data|json}}" /><Bildergalerie Data="{{data|json}}" /><Downloads Data="{{data|json}}" /><DownloadsWithPreview Data="{{data|json}}" /></Page></Data>

that resulted in exception:

JsonReaderException: Invalid property identifier character: {. Path '', line 1, position 1.]
Newtonsoft.Json.JsonTextReader.ParseProperty() +493
Newtonsoft.Json.JsonTextReader.ReadInternal() +77
Newtonsoft.Json.JsonTextReader.Read() +28
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CheckedRead(JsonReader reader) +21
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) +64
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) +188
Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) +851
Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +513
Newtonsoft.Json.JsonConvert.DeserializeObject(String value, JsonSerializerSettings settings) +189
Amba.ImagePowerTools.Fields.ImageMultiPickerField.get_Images() +182
ASP._Page_Modules_Amba_ImagePowerTools_Views_Fields_ImageMultiPicker_cshtml.Execute() in x:\xxx\Orchard\Modules\Amba.ImagePowerTools\Views\Fields_ImageMultiPicker.cshtml:25
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +158
Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:137
Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:118
Orchard.DisplayManagement.Descriptors.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:55
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:179
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:88
Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71
ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29
ClaySharp.ClayBehaviorCollection.Execute(Func1 proceed, Func3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:13
Orchard.Core.Shapes.CoreShapes.ContentZone(Object Display, Object Shape, TextWriter Output) in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Shapes\CoreShapes.cs:258

[TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.PerformInvoke(DisplayContext displayContext, MethodInfo methodInfo, Object serviceInstance) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:65
Orchard.DisplayManagement.Descriptors.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:55
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:179
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:88
Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71
ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29
ClaySharp.ClayBehaviorCollection.Execute(Func1 proceed, Func3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:13
ASP._Page_Core_Contents_Views_Content_SummaryAdmin_cshtml.Execute() in x:\xxx\Orchard\Core\Contents\Views\Content.SummaryAdmin.cshtml:29
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +158
Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:137
Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:118
Orchard.DisplayManagement.Descriptors.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:55
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:179
Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:88
Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in c:\Users\sebros\My Projects\Orchard\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:71
ClaySharp.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:29
ClaySharp.ClayBehaviorCollection.Execute(Func1 proceed, Func3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:13
System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +354
CallSite.Target(Closure , CallSite , Object , Object ) +592
Orchard.Core.Shapes.<>c__DisplayClass153.<List>b__150(Object item) in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Shapes\CoreShapes.cs:635
System.Linq.WhereSelectListIterator2.MoveNext() +245
System.Linq.WhereEnumerableIterator
1.MoveNext() +196
System.Collections.Generic.List1..ctor(IEnumerable1 collection) +536
System.Linq.Enumerable.ToList(IEnumerable1 source) +80
Orchard.Core.Shapes.CoreShapes.List(Object Display, TextWriter Output, IEnumerable
1 Items, String Tag, String Id, IEnumerable1 Classes, IDictionary2 Attributes, IEnumerable1 ItemClasses, IDictionary2 ItemAttributes) in c:\Users\sebros\My Projects\Orchard\src\Orchard.Web\Core\Shapes\CoreShapes.cs:635

[TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
Orchard.DisplayManagement.Descriptors.ShapeAttri

file attachments

comments

dpomt wrote Apr 2, 2013 at 4:56 PM

complete callstack

dpomt wrote Apr 9, 2013 at 2:24 PM

I am still facing this problem from time to time, and it happens more often the last days.
It starts when an edit page for a Content item with ImagePickerFields is rendered. The rendered page looks like shown in bug.PNG: even Images exist, they are not displayed (only that cryptical {{upload...}} is displayed.
The only this that helps is shutting down the orchard app pool (w3p.exe) - will work afterwards again.
If you do not shut down the app pool and click save instead, garbage like

<Data><Page><Bilder Data="{{data|json}}" /><Bildergalerie Data="{{data|json}}" /><Downloads Data="{{data|json}}" /><DownloadsWithPreview Data="{{data|json}}" /></Page></Data>

is saved in orchard database.
This will lead to failure to list content item itself as well as to list content items of the corresponding content type in dashboard.
Once you have that garbage in DB, the only way to get syste, work again is to delete the garbage from DB.


Please take care of that killing bug. Thanks.

musukvl wrote Apr 12, 2013 at 1:58 PM

Hi,
Thanks for help.
Looks like reason for exception is javascript error. Field editor had problems with IE8 and later.
Check version 2.1 it should be stable with old browsers. If bug.png case will exist, report javascript error, please.

mjy78 wrote Apr 23, 2013 at 6:51 AM

FYI. I'm running v2.1 (using Chrome Browser on Windows 7) and I had this same problem.

musukvl wrote Apr 25, 2013 at 8:03 PM

mjy78, check new version 2.1.1

rjmlopes wrote May 22, 2013 at 10:35 AM

I am having problems with this too.

When a try to edit a content I get a javascript error on this script:
<script type="text/javascript">
        angular.module('app_cd8599', ['MultipickerDashboard', 'ExtraEvents', 'AmbaSortableList', 'ui'])
            .value('data', {{data|json}})
Uncaught SyntaxError: Unexpected token {
            .value('options', {
                id: 'cd8599',
                fieldFolder: "/Media/Default/Amba.ImagePowerTools/ContentItem_194_Images",
                pickerWindowUrl: "/Amba.ImagePowerTools/Multipicker"
            });
            
        angular.bootstrap($('#app_cd8599'), ['app_cd8599']);       
    </script>
The problem is the: {{data|json}}

Also the drop files doesn't work on IE9 (Win7). Works fine on Chrome and Opera.

I have the same problems with version 2.1 and 2.2.1