U4-8290 - Label property editor should be configurable to declare data type storage (int, string, date, etc...)

Created by Shannon Deminick 06 Apr 2016, 08:53:50 Updated by Sebastiaan Janssen 25 May 2016, 11:29:10

Tags: PR Community Contrib

Relates to: U4-6003

The label just stores data as a string in the database, but now that we have sortable custom fields in the list view, if you were to add something like umbracoBytes as a column (which will always be an int) when you sort it will sort based on it's string value because that is where the data is stored.

To fix that we'd need to have the Label property editor support a configured data type, then we would be able to create a Data Type for a Label that stores INT (for example). Then in the future we could install a label data type for each storage type by default and set the umbracoBytes, umbracoHeight, etc... properties to use the INT storage so sorting on these custom columns would work properly.


Shannon Deminick 10 May 2016, 09:50:17


Stephan 24 May 2016, 07:46:49

@abutland Hey! Great PR, makes sense and by my test I can properly sort on an integer field. I have written a couple of comments on the PR if you have a min to answer?

Andy Butland 24 May 2016, 08:03:48

Thanks for looking at it. Have just done so - the fiddly bits are all around handling the fact that whilst the current label property type has no pre-values that can be saved, it can have them if it's been created from a legacy, now unsupported type.

Stephan 24 May 2016, 13:59:17

OK. Have merged the PR with an additional commit that cleans up a few things. Want to have a look and confirm it's all OK?

Test/Review: create label properties of type string, integer. Ensure that in eg list views, sorting by integer works.

Andy Butland 24 May 2016, 14:08:32

Looks fine to me - thanks.

Priority: Up for grabs

Type: Bug

State: Fixed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted: Pull request

Affected versions:

Due in version: 7.5.0

Sprint: Sprint 16

Story Points: