U4-2436 - Editing an existing property changes its alias

Created by Chriztian Steinmeier 28 Jun 2013, 08:19:49 Updated by Karl Tynan 24 Jul 2013, 09:57:29

Is duplicated by: U4-2537

Just discovered this in an Umbraco 6.1.1:

When I go back to edit an existing property's name, the alias changes in real time to "match" - just as it does during initial creation of a property. This shouldn't happen once a property has been saved, right? Actually, I only have to move the cursor around using the arrow keys inside the Name field for this to trigger.

I will often change the name of a property before deciding on the right name, but I would never want the alias to change once it has been created.

Comments

Jeroen Breuer 10 Jul 2013, 15:21:05

I'm also having this problem in 6.1.2 and it's very annoying. Even if I just select the text the alias is already updated. This can be pretty dangerous.


Stephan 10 Jul 2013, 15:46:34

That would be an unintended consequence of some of the refactoring I did to that part. Re-calculating the alias anytime something (even focus...) happens in the name... now sounds like a somewhat bad idea. But then when should it happen? Only the first time you edit it when the property is created, and then never anymore?


Jeroen Breuer 10 Jul 2013, 15:50:52

Yes I think it should only work when creating a property and not when editing it.


Stephan 10 Jul 2013, 15:59:21

Will (try to) have a look at it.


Stephan 12 Jul 2013, 14:21:24

In Umbraco.Web\umbraco.presentation\umbraco\controls\GenericProperties\GenericProperty.ascx we have a call to JavaScript method duplicatePropertyNameAsSafeAlias(name, alias)... that should in fact be called only for a new property, not when editing a property. Note for self: should probably replace that javascript block by:

$(function() { checkAlias('<%=tbAlias.ClientID%>'); var li = $('#<%=this.FullId%>'); var ul = li.closest('ul'); if (ul.hasClass('addNewProperty')) duplicatePropertyNameAsSafeAlias('<%=tbName.ClientID%>', '<%=tbAlias.ClientID%>'); }); But have no time to test right now.


Sebastiaan Janssen 15 Jul 2013, 14:53:57

@Stephan Almost. The this.FullId doesn't work as the new li doesn't get an Id. Changed to:

$(function () { checkAlias('<%=tbAlias.ClientID%>'); var textbox = $('#<%=tbAlias.ClientID%>'); var ul = textbox.closest('ul'); if (ul.hasClass('addNewProperty')) { duplicatePropertyNameAsSafeAlias('<%=tbName.ClientID%>', '<%=tbAlias.ClientID%>'); } });

Fixed in changeset 1cd2dc8a42dc63c3b532d065060143007d93c8fb


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category: UI

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.1.1, 6.1.2

Due in version: 6.1.3

Sprint:

Story Points:

Cycle: