UrlPicker doesn't support '-' (dash) in alias (uComponents 5.0.0 and umbraco 4.9.0)


When there is a dash on the UrlPicker alias name, the control is not render on the page and produce javascript error on the page.

Sample :
Alias : rotatorItemTargetUrl_fr-CH

Chrome Javascript error :
Uncaught SyntaxError: Unexpected token -
Uncaught ReferenceError: mc_body_prop_rotatorItemTargetUrl_fr is not defined
Closed Sep 26, 2013 at 10:25 AM by leekelleher
Closing this workitem, as it's not an issue with uComponents specifically, but a bug in the core.

An issue has been raised on the core's issue tracker:


leekelleher wrote Jan 28, 2013 at 12:20 PM

@diachedelic - What are your thoughts about making a new XML schema - essentially one that removes the dashes and uses PascalCase? (This would be in addition to XML, CSV and JSON ... maybe called XmlNew?)

diachedelic wrote Feb 5, 2013 at 3:13 AM

@lee - Hmm...i think this work item is about something entirely different from the xml schema. He's saying that having a dash in the property alias causes an error in the URL picker UI.

Do you think there's still a problem with having dashes in the XML? I haven't heard any complaints about it since razor model binding came in.

leekelleher wrote Feb 5, 2013 at 10:18 AM

@diachedelic - Yes, sorry - my comment went off on a tangent, not directly relevant to the issue.

(Yes, think model binding sorts it out - now we need a "PropertyEditorConverter" for v6 :-)

As for this issue, is there a JS reference to the container tag?

leekelleher wrote Sep 11, 2013 at 5:08 PM

Update on this issue. Found out that it's not UrlPicker's bug (as such), but that the underlying Content Picker that doesn't like the dashes in it's alias.

The place where UrlPicker falls over (in UrlPickerScripts.js) is here:
contentPickerApi = Umbraco.Controls.TreePicker.GetPickerById($views.filter(".content").attr("data-id"));
Seems that the Umbraco.Controls.TreePicker collection doesn't work with dashes.
For an example: try creating a standard Content Picker with a dash in the alias.

leekelleher wrote Sep 11, 2013 at 5:33 PM

More details about the core bug here: http://issues.umbraco.org/issue/U4-2840