U4-6941 - Can't edit masterpages templates in 7.3.0 beta3

Created by Sebastiaan Janssen 10 Aug 2015, 11:41:19 Updated by Shannon Deminick 07 Sep 2015, 18:29:45

Relates to: U4-5741

This is in debug=false mode.

js error in the minified file: Uncaught TypeError: htmlMode.startState is not a function

return { startState: function() { var state = htmlMode.startState(); return { token: html, localMode: null , localState: null , htmlState: state }; },

1 Attachments

Comments

Sebastiaan Janssen 10 Aug 2015, 11:51:41

Note: Also doesn't work with debug=true


Stephan 02 Sep 2015, 14:24:43

Confirmed. Looking into it.

Related question: if I create a template, it is created by default as a view (~/Views/Template.cshtml). If I paste the appropriate WebForms master code into it and save, the corresponding ~/MasterPages/Template.master file is created, but the original Template.cshtml file is ''not'' removed. And so, when I try to edit the template again, what I see is the Razor code, not the WebForms code. Is this expected? Or an issue?


Sebastiaan Janssen 02 Sep 2015, 14:31:28

This is quite intentional as we want to help people migrate from masterpages > mvc (and not really the other way around!!). So when MVC views are preferred over masterpages if both exist. :-) Quite an edge case and not something we need to spend time on right now.


Stephan 02 Sep 2015, 14:34:11

It's just weird that when you save some WebForms content and come back to the template, what you see is the Razor content, without a warning - so it is, in fact, no possible to create a WebForms master in the backend once you have decided that Razor was the default. Again, may be intentional, but confusing ;-)


Sebastiaan Janssen 02 Sep 2015, 14:41:03

It is, there's another issue for it somewhere and it's "up for grabs". It has been like this for 18 months and that other issue is the first complaint we had, so it seems like an edge case. :-)


Stephan 02 Sep 2015, 15:03:19

In order to fix the issue I need to uncomment those three lines in CodeArea.cs. And then it works.

ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/xml/xml.js", "UmbracoRoot", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/javascript/javascript.js", "UmbracoRoot", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(1, "lib/CodeMirror/mode/css/css.js", "UmbracoRoot", ClientDependencyType.Javascript);

They have been commented out by @Shandem as part of U4-5741, but the HtmlMixed mode requires the Xml, Css and JavaScript modes AFAIK. Not sure whether all this is intentional?


Shannon Deminick 07 Sep 2015, 18:29:43

Have uncommented that (and moved the htmlmixed to be after those three). I think i was either under the impression that it would lazy load in it's required assets or i was testing and forgot about this. All good now though.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.3.0

Sprint:

Story Points:

Cycle: