U4-7787 - Shorthand use of ?altTemplate= doesn't work

Created by Douglas Robar 19 Jan 2016, 16:09:48 Updated by Chriztian Steinmeier 29 Jan 2016, 21:47:47

Is duplicated by: U4-7830

Seen in 7.4.0 Beta2

  1. In a working site with content...
  2. Create a new template (I called mine 'Add Question')
  3. Visit the website and display a page using the new template by using mypage?altTemplate=AddQuestion
  4. Now simplify the url to the shorthand alternate template format mypage/AddQuestion
  5. This won't find the page/template and will give a 404 error.

Comments

Anders Brannmark 21 Jan 2016, 15:47:03

This also effects 7.3.5


Neil Gaietto 21 Jan 2016, 23:26:25

I believe this issue is due to "UmbracoContext.Current.Application.Services.FileService.GetTemplate" now being case-sensitive. It was not case-sensitive in versions before 7.3.5. I don't know if it is exactly that function, but it also stopped working with this upgrade. When I changed all my Template Aliases in the db to lower-case it fixed the problem, so it prevents upper-cased templates aliases from working properly.


Sebastiaan Janssen 26 Jan 2016, 15:07:49

Commit made by '''Sebastiaan Janssen''' on ''2016-01-26T16:07:44+01:00'' https://github.com/umbraco/Umbraco-CMS/commit/e461cb92da18c0f9cb99087de98e76251bac5242

U4-7787 Shorthand use of ?altTemplate= doesn't work

#U4-7787 Fixed


Sebastiaan Janssen 26 Jan 2016, 15:09:00

Good catch @ngaietto ! Found the problem, we'll release 7.3.6 in a few days to fix this and it will also be fixed in 7.4.0 of course.


Douglas Robar 26 Jan 2016, 15:13:14

@sebastiaan I don't think it is related to capitalization. A template with an alias (as reported in the back office) of 'AddQuestion' works with foobar?altTemplate=AddQuestion but doesn't work with /foobar/AddQuestion nor with any capitalization of 'addquestion' I have tried.

Which makes me question the proposed fix.


Damiaan Peeters 26 Jan 2016, 15:18:03

@drobar The request pipeline lowercases all the thing if I remember correctly. If you change your template aliases to lowercase, you will see it all works again. (just did it)

update: I didn't try the altTemplate syntax.


Sebastiaan Janssen 26 Jan 2016, 15:25:13

I could repro, changing it to InvariantContains helped and I can use both variants in upper and lower and mixed cases now, so I'm confident it's fixed. :)


Douglas Robar 26 Jan 2016, 15:42:34

@sebastiaan excellent, thx for the double-check


Chriztian Steinmeier 29 Jan 2016, 21:47:47

Great - was just about to release a bugfix for a package, but seems I can just add a note about a workaround :-)


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.0, 7.3.5

Due in version: 7.3.6

Sprint:

Story Points:

Cycle: