U4-9872 - Umbraco 7.6 - ContentPicker2 and umbracoInternalRedirectId

Created by Michael Sølvsteen 08 May 2017, 12:08:03 Updated by Arjan Hoogervorst 26 May 2017, 12:12:42

Tags: PR

Relates to: U4-9897

Subtask of: U4-9609

Just installed Umbraco 7.6 and set up a "Site"-documenttype, with a ContentPicker property for picking the actual frontpage to be displayed. I've set the alias of the property to "umbracoInternalRedirectId", which should make the frontpage appear, without the url changing.

The issue is, that the new ContentPicker2 is saving the data in the database as "umb://document/....." but it expects an integer. If I change the propertyeditor to a numeric field, it works like a charm.

It looks like the int parsing is happening right here: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/Routing/PublishedContentRequestEngine.cs#L531


James Coxhead 10 May 2017, 16:02:22

I've also noticed this and a similar issue with the umbracoRedirect property.

James Coxhead 14 May 2017, 21:00:09

I've submitted a PR for this: https://github.com/umbraco/Umbraco-CMS/pull/1942

Søren Gregersen 14 May 2017, 21:39:46

Great work James.

I was thinking why you have two convert-attempts, when only one of them is used?

By putting your try-convert code in a new method you should be able to

var a = tryConvertToInt(); if(a.Ok) return a.Value;

var b = tryConvertToUdi(); if(b.Ok) return b.Value;

I Also belive there is a setting for what kind of id is in use.

Sebastiaan Janssen 20 May 2017, 09:38:28

Thanks! I mades some changes as Søren suggested. https://github.com/umbraco/Umbraco-CMS/commit/22d778ed28c1ee6e9182d05a32210e1754afd6be

Priority: Normal

Type: Bug

State: Fixed


Difficulty: Normal

Category: UI

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.0, 7.6.1

Due in version: 7.6.2


Story Points:

Cycle: 1