Copied to clipboard

Flag this post as spam?

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


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 25, 2012 @ 21:52
    Jan Skovgaard
    0

    Google WebFont Property editor - Index was outside the bounds of the array

    Hi Warren

    When I gave this a spin I managed to get a YSOD. The stack trace is posted below.

    I'm using Umbraco 5.1RC.

    When I have chosen a font-variant and want to make a vertical pipe seperated string like "header|paragraph" i get the ysod.

     

    Server Error in '/' Application.

    Index was outside the bounds of the array.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       WebFont.Umbraco.PropertyEditor.WebFontModel.GetSerializedValue() +656
       Umbraco.Cms.Web.Mapping.ContentPropertyToTypedAttribute.<.ctor>b__2(ContentProperty source, TypedAttribute dest) +205
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.ExecuteAfterMap(TSource source, TTarget target) +27
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.Map(TSource source, MappingExecutionScope scope) +53
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.Map(TSource source) +54
       Umbraco.Cms.Web.Mapping.<>c__DisplayClassc.<.ctor>b__0(TContentModel source, TTypedEntity dest) +547
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.ExecuteAfterMap(TSource source, TTarget target) +27
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.Map(TSource source, TTarget target) +69
       Umbraco.Framework.TypeMapping.AbstractTypeMapper`2.Map(Object source, Object target) +71
       Umbraco.Framework.TypeMapping.AbstractFluentMappingEngine.Map(Object source, Object destination, Type sourceType, Type destinationType) +135
       Umbraco.Framework.TypeMapping.MappingEngineCollection.Map(Object source, Object destination, Type sourceType, Type destinationType) +45
       Umbraco.Framework.TypeMapping.AbstractMappingEngine.Map(TSource source, TDestination destination) +88
       Umbraco.Cms.Web.Editors.AbstractRevisionalContentEditorController`1.ProcessSubmit(TEditorModel model, Revision`1 entity, Boolean isRevisional) +545
       Umbraco.Cms.Web.Editors.ContentEditorController.ProcessSubmit(ContentEditorModel model, Revision`1 entity, Boolean isRevisional) +44
       Umbraco.Cms.Web.Editors.AbstractRevisionalContentEditorController`1.EditForm(Nullable`1 id, Nullable`1 revisionId) +599
       lambda_method(Closure , ControllerBase , Object[] ) +176
       System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
       System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
       System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263
       System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
       Umbraco.Cms.Web.Mvc.ActionInvokers.ControllerExtenderActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +341
       System.Web.Mvc.Controller.ExecuteCore() +116
       System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
       System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
       System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21
       System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50
       System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
       System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8970061
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 25, 2012 @ 22:10
    Warren Buckley
    0

    Hey Jan,
    Thanks for testing this out and finding this bug.
    What font did you choose from the dropdown please and what variants did you check if any?

    Also did you put in a CSS selector for each font variant selected?
    What values are in the textbox below the previews?

    Cheers,
    Warren 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 26, 2012 @ 00:11
    Jan Skovgaard
    0

    Hi Warren

    I've tried with different fonts - the chosen font does not seem to matter.

    However I discovered that i happens if I declare more selectors thant I have selected variants for.

    So if for instance I select the font "Alegrya SC" and choose "Alegreya SC - 400" as the font variant and I then declare more than 1 selector I get the above error.

    If I just declare 1 selector everything is fine.

    If I select 2 variants and declare 2 selectors everything is fine. If I declare 3 selectors the bug appears.

    I hope this helps.

    /Jan

     

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 26, 2012 @ 09:31
    Warren Buckley
    0

    Hi Jan,
    OK thanks for finding this. So it's a problem thrown up by UX.

    I need to do a couple of things then:
    Firstly only show the CSS selector textareas when a variant is selected and the second part of the value textboxes below I will either hide them or make them read only, as it was designed for me to see what values were being saved. DO you think it's useful to see what values are being saved?

    Cheers,
    Warren 

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 26, 2012 @ 23:25
    Jan Skovgaard
    0

    Hi Warren

    You're welcome :)

    Hope that you will be able to have a look at my suggestions also - let me know if something is not clear.

    Regarding the last question...yes and no.

    From an editors point of view they should not be bothered seeing the values since all they should care about is to choose a font and some variants of the font.

    From a developers point of view it's indeed usable and perhaps a must to be able to easily see the values...

    I think it's a bit of a UX challenge, which I can't currently give a nice suggestion on how to solve. But I'll try to keep it in the back of my mind and let you know if I figure out something :)

    /Jan

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 29, 2012 @ 14:09
    Warren Buckley
    1

    Hi Jan,
    I have released 1.0.1 which fixes the prevalue lable for preview paragraph text and makes the input boxes at the bottom read only, as they are not to be edited.
    If you don't mind giving this a test and see if you can still get this error or not.

    Thanks,
    Warren 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 29, 2012 @ 21:09
    Jan Skovgaard
    0

    Hi Warren

    I just gave 1.0.1 a spin and the bug seems to be fixed now. I could not reproduce. However I think that it might be a good idea to perhaps validate on the selectors field to ensure all the necessary selectors have been chosen? Or am I missing the point? :)

    /Jan

  • Warren Buckley 2106 posts 4836 karma points MVP 7x admin c-trib
    Apr 29, 2012 @ 21:20
    Warren Buckley
    0

    Hey Jan,
    Great that those small isues are fixed. Yeh I am trying to think on how best to do validation for those textarea fields.

    As I need to add valifdation to those textarea boxes only when the corrosponding checkbox is checked, got any smart ideas?

    Cheers,
    Warren 

Please Sign in or register to post replies

Write your reply to:

Draft