U4-6955 - Styles of Umbraco.Grid data type fails to load when the modifier property for the style has no characters after the placeholder

Created by haileqsr 12 Aug 2015, 11:25:53 Updated by Shannon Deminick 08 Sep 2015, 17:03:19

When adding a style to a data type of Umbraco.Grid, the value fails to properly load when the modifier property for the style has no characters following the value placeholder "{0}"

This is due to the way that the value is extracted from the style rule, split is used to obtain the number of characters before and after the placeholder and then slice is used to extract the value using them. However, if there are 0 characters after the placeholder the actual value is also removed when slice is applied.

Steps to reproduce:

  1. In the Umbraco backoffice open Developer / Data Types / Grid TextPage
  2. Under grid configuration select to edit styles
  3. Add a new style with key "background-color" modifier "#{0}" and view "textstring" - save changes
  4. Open a node that uses the data type and open row settings
  5. Add a background color such as FFFFFF - save changes
  6. Open the settings again, the value is not set


Shannon Deminick 12 Aug 2015, 11:33:24

PR: https://github.com/umbraco/Umbraco-CMS/pull/756

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 7.3.0


Story Points: