U4-6411 - UserType with apostrophe gives YSOD

Created by Douglas Robar 17 Mar 2015, 10:03:25 Updated by Claus Jensen 05 Jul 2017, 10:34:00

Subtask of: U4-8632

Seen in 7.2.2

Create a new User Type

Include an apostrophe in the name (such as "Look but don't touch")

Save the new UserType

Click to display the settings for an existing User (the user doesn't need to be set to this type, simply having an apostrophe in the list of user types is enough)

YSOD (see below)

[XPathException: '//area [@alias = 'user']/key [@alias = 'look don't touch']' has an invalid token.] MS.Internal.Xml.XPath.XPathParser.CheckToken(LexKind t) +7331777 MS.Internal.Xml.XPath.XPathParser.ParsePredicate(AstNode qyInput) +119 MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput) +163 MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput) +27 MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput) +40 MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput) +27 MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput) +29 MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput) +29 MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput) +29 MS.Internal.Xml.XPath.XPathParser.ParseExpresion(AstNode qyInput) +46 MS.Internal.Xml.XPath.QueryBuilder.Build(String query, Boolean allowVar, Boolean allowKey) +91 System.Xml.XPath.XPathNavigator.Evaluate(String xpath, IXmlNamespaceResolver resolver) +63 System.Xml.XPath.Extensions.XPathSelectElements(XNode node, String expression, IXmlNamespaceResolver resolver) +65 Umbraco.Core.Services.LocalizedTextService.GetFromXmlSource(CultureInfo culture, String area, String key, IDictionary2 tokens) +358 Umbraco.Core.Services.LocalizedTextService.Localize(String key, CultureInfo culture, IDictionary2 tokens) +303 umbraco.cms.presentation.user.EditUser.Page_Load(Object sender, EventArgs e) +428 umbraco.BasePages.BasePage.OnLoad(EventArgs e) +19 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

Comments

Douglas Robar 17 Mar 2015, 10:05:36

I should mention that the workaround is to return to the UserType and remove the apostrophe from the name. Then save the updated UserType and all will be well. Though having a usertype without the apostrophe isn't pretty ("Look but dont touch"). I guess the larger workaround is to stop using apostrophes when updating the usertype name ("Look but do not touch").

Still, it's too easy to get a YSOD and should be fixed.


Shannon Deminick 26 Jun 2017, 07:08:48

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Douglas Robar 26 Jun 2017, 10:14:22

Still a bug in 7.6.3.


Shannon Deminick 26 Jun 2017, 23:59:59

This will be all overhauled in 7.7, i'll be sure that apostrophe's still don't have issues though


Shannon Deminick 04 Jul 2017, 02:42:31

In 7.7 user groups have aliases and these aliases are cleaned just like other umbraco aliases, an apostrophe will be stripped out of the alias but the group name can still have one


Claus Jensen 05 Jul 2017, 10:33:57

Stripping stuff works - and it no longer gives a YSOD (yay!).

If you really want/need something like this in your names, you can work around it by using ยด instead of ', as that will not be stripped out.


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.2, 7.6.3

Due in version: 7.7.0

Sprint: Sprint 62

Story Points: 1

Cycle: