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.
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.
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?
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 :)
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.
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? :)
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:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
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
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
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
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
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
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
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
is working on a reply...