November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Is anyone else noticing this issue? I have some must have functionality that was written for EPi in dojo and without the module.config loading and issues, we are losing that functionality.
After some more research, it appears the module.config is getting hit (if i add an assembly reference in it that doesn't exist, the site errors, which is how i tested to confirm the module.config is actually getting parsed) - but it appears all the dojo namespace and client resources are getting ignored completely now in 7.1
any one have any thoughts on this?
I fiddled with this all weekend and I am still unable to get my custom dojo initialize module and anything in the <dojo> or even (as it was in 7) <dojoModules> section of Module.config to be used. I need to find a solution soon as we are nearing our production date and would love to use 7.1, but won't be able to if i can't get this working.
The same issue happening here. Is was working in 7.0, it always try to load the file from EPiServer/Shell/2.0.86/ClientResources/dtk/
Could you please post an extract of the dojo or dojoModules section of your config. Could you, in your web console, enter the following and post the returned object also:
dojo.config
Changing to use dojo instead of dojoModules is good but using dojoModules should still work. As part of 7.1 we've upgraded dojo to version 1.8.3 which has some changes in the loader. This could be affecting your javascript loading. It's very hard to say without seeing any errors or configs.
Below is my module.config (i have tried variations in 7.1 - switching to <dojo><paths> and also switching my clientresources to <clientmodule initializer="phoenixweb.initialize">)
<?xml version="1.0" encoding="utf-8"?>
<module clientResourceRelativePath="/Plugins">
<dojoModules>
<add name="phoenixweb" path="/Plugins" />
</dojoModules>
<clientResources>
<add name="epi.cms.widgets.base" path="Initialize.js" resourceType="Script" />
</clientResources>
</module>
and here is the dojo.config from console (the path for phoenixweb is loading - i'm not sure where to check to see if my clientresource (the initializer) is being loaded) - There are no errors reported in console and also checking resources, i do not see my initialize.js being loaded.
dojo.config
Object {async: true, packages: Array[0], baseUrl: "/episerver/Shell/2.0.86/ClientResources/dtk/dojo/", aliases: Array[3], deferredInstrumentation: false…}
afterOnLoad: true
aliases: Array[3]
0: Array[2]
1: Array[2]
2: Array[2]
length: 3
__proto__: Array[0]
async: true
baseUrl: "/episerver/Shell/2.0.86/ClientResources/dtk/dojo/"
cache: Object
config: undefined
deferredInstrumentation: false
ioPublish: true
isDebug: false
locale: "en-us"
packages: Array[0]
length: 0
__proto__: Array[0]
parseOnLoad: false
paths: Object
dgrid: "/episerver/Shell/2.0.86/ClientResources/lib/dgrid"
epi: "/episerver/Shell/2.0.86/ClientResources/EPi"
epi-cms: "/episerver/CMS/2.0.79/ClientResources/EPi/Cms"
epi-packaging: "/episerver/EPiServer.Packaging.UI/2.0.86/ClientResources"
epi/cms: "/episerver/CMS/2.0.79/ClientResources/EPi/Cms"
phoenixweb: "/Plugins"
put-selector: "/episerver/Shell/2.0.86/ClientResources/lib/put-selector"
tinymce: "/episerver/CMS/2.0.79/ClientResources/Editor/tiny_mce"
xstyle: "/episerver/Shell/2.0.86/ClientResources/lib/xstyle"
__proto__: Object
useDeferredInstrumentation: ""
__proto__: Object
You need to change the key in your clientResource to be epi-cms.widgets.base
This changed as part of the namespace change that happened for CMS with the upgrade to dojo 1.8.3 (although it didn't really need to change we just like to be consistant). Unfortunetly this isn't documented as it isn't really indended for public use. However have blogged about it previously since there is currently no really easy way to have a module start without a component. (This will change in the next release!)
Let me know if you still have problems.
That worked! I guess I missed that when i changed things from epi.cms to epi-cms! Thanks!
Now, is the way i'm doing it the only way to get my initializer to load? I've seen examples (from blog posts and from epi module.configs in the Modules folder) where you can do <clientModule initializer="phoenixweb.Initialize"> but that doesn't seem to work or load my initialize.js - however the way i'm doing it above (when i change to epi-cms.widgets.base) works perfectly.
Just asking for reference and understanding.
Currently the only way to get code to run using the <clientModule initializer="..."> is to have a UI component start the module (I think Linus has a blog about this). These are the things that appear in the panes on the left and right. But that is not ideal when you don't need a component.
The way you have it now is a little trick that will get a custom initializer to run. This is something I blogged about a while ago but was never really indended as the way things should be done. Hence no real documentation about it.
We have developed a better way to start modules but this won't be released until the next framework release.
Thanks Ben. That makes sense.
As soon as I said it worked however (which it DID work initially) - now my global toolbar command is not showing again, however the js files are being loaded and my initialize is being loaded, but i don't think it is necessarily being run (js breakpoints do not get hit) - I am trying to investigate why it wouldn't be working - there are no js errors being reported.
By following the steps in your blog i was able to get it to load again - I had moved away from your method in 7 and used a GlobalToolbarCommandProvider w/ a registry to the globalToolbar in my initialize. After using your methods and just issuing the command directly from the initilizer (basically skipping my own provder which based off _GlobalToolbarCommandProvider) - everything appears to work.
I'll use what you have documented in your blog as it seems to work the most consistently until the next release and further documentation is released. Thanks for your help!
The initialize still does not work for it, it worked greate in version 7. Below is my module.config
<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="true">
<assemblies>
<add assembly="myproject.web" />
</assemblies>
<dojo>
<paths>
<add name="myproject.web" path="Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="Scripts/ModuleInitializer.js" resourceType="Script" />
<add name="epi-cms.widgets.base" path="Style/displayresolution.css"
resourceType="Style" isMinified="false" />
<add name="epi-cms.widgets.base" path="Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
<add name="ArticleTab.css" path="Style/ArticleTab.css" resourceType="Style" />
<add name="Image.css" path="Style/Image.css" resourceType="Style" />
</clientResources>
<clientModule initializer="myproject.web.ModuleInitializer">
<moduleDependencies>
<add dependency="Shell" />
<add dependency="CMS" />
</moduleDependencies>
<requiredResources>
<add name="ArticleTab.css" />
<add name="Image.css" />
</requiredResources>
</clientModule>
</module>
And below is the error in the console
Failed to load resource: the server responded with a status of 404 (Not Found) http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/myproject/web/ModuleInitializer.js
Error
get stack: function () { [native code] }
info: Array[2]
message: "scriptError"
set stack: function () { [native code] }
src: "dojoLoader"
__proto__: d
dojo.js:15
_c.uid dojo.js:15
3
Error: scriptError
at _f (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:436)
at HTMLScriptElement.<anonymous> (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:17711) widgets.js:2
dojo.config
Object {async: true, packages: Array[0], baseUrl: "/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/", aliases: Array[3], deferredInstrumentation: false…}
afterOnLoad: true
aliases: Array[3]
0: Array[2]
0: /^epi\/cms\/form\/SearchTextBox$/
1: "epi-cms/form/SearchTextBox"
length: 2
__proto__: Array[0]
1: Array[2]
0: /^epi\/cms\/contentediting\/editors\/SelectionEditor$/
1: "epi-cms/contentediting/editors/SelectionEditor"
length: 2
__proto__: Array[0]
2: Array[2]
0: /^epi\/cms\/form\/PageInfoPicker$/
1: "epi-cms/form/PageInfoPicker"
length: 2
__proto__: Array[0]
length: 3
__proto__: Array[0]
async: true
baseUrl: "/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/"
cache: Object
config: undefined
deferredInstrumentation: false
ioPublish: true
isDebug: false
locale: "en-us"
packages: Array[0]
parseOnLoad: false
paths: Object
useDeferredInstrumentation: ""
__proto__: Object
module.cònig
ReferenceError: module is not defined
module.config
ReferenceError: module is not defined
It should load the file from Scripts/ModuleInitializer.js?
Hey Hai,
Try this:
<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="true">
<assemblies>
<add assembly="myproject.web" />
</assemblies>
<dojo>
<paths>
<add name="myproject-web" path="/Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="/Scripts/ModuleInitializer.js" resourceType="Script" />
<add name="epi-cms.widgets.base" path="/Style/displayresolution.css"
resourceType="Style" isMinified="false" />
<add name="epi-cms.widgets.base" path="/Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
<add name="ArticleTab.css" path="/Style/ArticleTab.css" resourceType="Style" />
<add name="Image.css" path="Style/Image.css" resourceType="Style" />
</clientResources>
<clientModule initializer="myproject-web/ModuleInitializer">
<moduleDependencies>
<add dependency="Shell" />
<add dependency="CMS" />
</moduleDependencies>
<requiredResources>
<add name="ArticleTab.css" />
<add name="Image.css" />
</requiredResources>
</clientModule>
</module>
In the long term though, I would suggest moving your epi dojo plugins into a directory of their own (seperate from template js and styles) - I made a Plugins folder and inside put a ClientResources that held Scripts and Styles (I went further and categorized everything since I have a lot of widgets i've created, but you don't have to if you don't want).
So a directory structure like so:
Plugins
ClientResources
Scripts
Styles
You then can have your module.config look like:
<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="true" clientResourceRelativePath="/Plugins">
<assemblies>
<add assembly="myproject.web" />
</assemblies>
<dojo>
<paths>
<add name="myproject-web" path="ClientResources/Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="ClientResources/Scripts/ModuleInitializer.js" resourceType="Script" />
<add name="epi-cms.widgets.base" path="ClientResources/Styles/displayresolution.css"
resourceType="Style" isMinified="false" />
<add name="epi-cms.widgets.base" path="ClientResources/Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
<add name="ArticleTab.css" path="ClientResources/Styles/ArticleTab.css" resourceType="Style" />
<add name="Image.css" path="ClientResouces/Style/Image.css" resourceType="Style" />
</clientResources>
<clientModule initializer="myproject-web/ModuleInitializer">
<moduleDependencies>
<add dependency="Shell" />
<add dependency="CMS" />
</moduleDependencies>
<requiredResources>
<add name="ArticleTab.css" />
<add name="Image.css" />
</requiredResources>
</clientModule>
</module>And below is the error in the console
just a thought, hope it helps!
Hai I'm not sure why you are trying to load ModuleInitializer in both <clientModule initializer="..."> and as a client resource. Judging from the error I'd say that you have a UI component which causes your module to be started with the specificied initializer. If this is the case you can remove the entry from the client resources to ensure it doesn't run twice.
The error you are getting is likely due to the way you have named your module. In dojo 1.8 they moved away from the dot syntax to AMD, which is in essence a path syntax (i.e. using slashes). They also added backwards compatibility to the loader. This means that your module myproject.web.ModuleInitializer gets run by the loader as myproject/web/ModuleInitializer; as seen in your error. It doesn't map correctly because you have no path mapping for "myproject". You only have a mapping for "myproject.web".
That said, my suggested fix would be to change your path mapping to be:
<dojo>
<paths>
<add name="myproject" path="ClientResources/Scripts" />
</paths>
</dojo>
I would also suggest changing the reference to the initializer to be slash notation instead. So:
<clientModule initializer="myproject/web/ModuleInitializer">
Thank you Ben for the tip!
Unfortunately, it does not work. I checked the dojo.config and saw that the path was added correctly, however CMS still try to find my file in the http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/myproject/web/ModuleInitializer.js
Did I miss anything?
Regards,
Hai
Hi,
Below is the value of the dojo.config
Object {aliases: Array[3], packages: Array[0], deferredInstrumentation: false, useDeferredInstrumentation: "", isDebug: false…}
aliases: Array[3]
async: true
deferredInstrumentation: false
ioPublish: true
isDebug: false
locale: "en-us"
packages: Array[0]
parseOnLoad: false
paths: Object
myproject: "/ClientResources/Scripts"
dgrid: "/EPiServer/Shell/2.0.86/ClientResources/lib/dgrid"
epi: "/EPiServer/Shell/2.0.86/ClientResources/EPi"
epi-cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
epi-packaging: "/EPiServer/EPiServer.Packaging.UI/2.0.86/ClientResources"
epi-socialreach: "/EPiServer/EPiServer.Social/1.4.0.0/Scripts"
epi/cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
put-selector: "/EPiServer/Shell/2.0.86/ClientResources/lib/put-selector"
tinymce: "/EPiServer/CMS/2.0.79/ClientResources/Editor/tiny_mce"
xstyle: "/EPiServer/Shell/2.0.86/ClientResources/lib/xstyle"
__proto__: Object
useDeferredInstrumentation: ""
__proto__: Object
It seems that the path is correct.
Regards,
Hai
Hi,
The span tag was a typo when I paste the code from browser to a text editor, it looks exactly as below
Object {aliases: Array[3], packages: Array[0], deferredInstrumentation: false, useDeferredInstrumentation: "", isDebug: false…}
aliases: Array[3]
async: true
deferredInstrumentation: false
ioPublish: true
isDebug: false
locale: "en-us"
packages: Array[0]
parseOnLoad: false
paths: Object
myproject: "/ClientResources/Scripts"
dgrid: "/EPiServer/Shell/2.0.86/ClientResources/lib/dgrid"
epi: "/EPiServer/Shell/2.0.86/ClientResources/EPi"
epi-cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
epi-packaging: "/EPiServer/EPiServer.Packaging.UI/2.0.86/ClientResources"
epi-socialreach: "/EPiServer/EPiServer.Social/1.4.0.0/Scripts"
epi/cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
put-selector: "/EPiServer/Shell/2.0.86/ClientResources/lib/put-selector"
tinymce: "/EPiServer/CMS/2.0.79/ClientResources/Editor/tiny_mce"
xstyle: "/EPiServer/Shell/2.0.86/ClientResources/lib/xstyle"
__proto__: Object
useDeferredInstrumentation: ""
__proto__: Object
I can't see any reason why it would get a 404. Can you paste your updated module.config
Thank you,
This is my current module.config
<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="true">
<assemblies>
<add assembly="myproject.web" />
</assemblies>
<dojo>
<paths>
<add name="myproject.web" path="Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="Style/displayresolution.css"
resourceType="Style" isMinified="false" />
<add name="epi-cms.widgets.base" path="Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
<add name="ArticleTab.css" path="Style/ArticleTab.css" resourceType="Style" />
<add name="Image.css" path="Style/Image.css" resourceType="Style" />
</clientResources>
<clientModule initializer="myproject.web.ModuleInitializer">
<requiredResources>
<add name="ArticleTab.css" />
<add name="Image.css" />
</requiredResources>
</clientModule>
</module>
And this is the error from the console:
GET http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/myproject/web/ModuleInitializer.js 404 (Not Found) dojo.js:15
Error {src: "dojoLoader", info: Array[2]}
dojo.js:15
Error: scriptError
at _f (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:436)
at HTMLScriptElement.<anonymous> (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:17711) widgets.js:2
Error: scriptError
at _f (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:436)
at HTMLScriptElement.<anonymous> (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:17711) widgets.js:2
Error: scriptError
at _f (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:436)
at HTMLScriptElement.<anonymous> (http://upgrade.amelia.dev/EPiServer/Shell/2.0.86/ClientResources/dtk/dojo/dojo.js:15:17711) widgets.js:2
dojoConfig
Object {aliases: Array[3], packages: Array[0], deferredInstrumentation: false, useDeferredInstrumentation: "", isDebug: false…}
aliases: Array[3]
async: true
deferredInstrumentation: false
ioPublish: true
isDebug: false
locale: "en-us"
packages: Array[0]
parseOnLoad: false
paths: Object
myproject.web: "/ClientResources/Scripts"
dgrid: "/EPiServer/Shell/2.0.86/ClientResources/lib/dgrid"
epi: "/EPiServer/Shell/2.0.86/ClientResources/EPi"
epi-cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
epi-packaging: "/EPiServer/EPiServer.Packaging.UI/2.0.86/ClientResources"
epi-socialreach: "/EPiServer/EPiServer.Social/1.4.0.0/Scripts"
epi/cms: "/EPiServer/CMS/2.0.79/ClientResources/EPi/Cms"
put-selector: "/EPiServer/Shell/2.0.86/ClientResources/lib/put-selector"
tinymce: "/EPiServer/CMS/2.0.79/ClientResources/Editor/tiny_mce"
xstyle: "/EPiServer/Shell/2.0.86/ClientResources/lib/xstyle"
__proto__: Object
useDeferredInstrumentation: ""
__proto__: Object
Hai,
try adding clientResourceRelativePath="/Scripts" to your <module> line.
The reason it can't find your scripts is because you arent defining the relative path the module.config should use, so it falls back on episerver's which is the path you are seeing being appended to your Scripts and Styles folders. Another edit is to put a leading '/' in front of all your Script and Style directory calls. This will tell epi and dojo that the scripts to load are relative from the root of your website.
Take a look at my previous post to you, it should have some examples on how to modify your module.config correctly.
<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="true">
<assemblies>
<add assembly="myproject.web" />
</assemblies>
<dojo>
<paths>
<add name="myproject" path="Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="Style/displayresolution.css" resourceType="Style" isMinified="false" />
<add name="epi-cms.widgets.base" path="Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
<add name="ArticleTab.css" path="Style/ArticleTab.css" resourceType="Style" />
<add name="Image.css" path="Style/Image.css" resourceType="Style" />
</clientResources>
<clientModule initializer="myproject/web/ModuleInitializer">
<requiredResources>
<add name="ArticleTab.css" />
<add name="Image.css" />
</requiredResources>
</clientModule>
</module>
Seems like you haven't made any changes to your module.config file. Use this module.config instead.
Thank you very much Ben and Mike!
Finally, I got it work. But I still have a problem with loading menucontext.js and folderlist.js, We have a lot of componets in Edit mode, after go to 7.1 all the components which use contextmenu and forderlist are fail :(. Do you guys have any ideas about this? I checked in the 7.0 these files exsist in the VPP, but in 7.1 they seem to be deleted.
Thank you very much!
Fixed!
EPiServer moves the contextmenu from "epi/widget/ContextMenu" to "epi/shell/widget/ContextMenu" so change this path solved the issue.
I have applied UI updates via Add-on but cannot get the CMS editor to load????
I have removed temp .Net files etc. and edited module config e.g epi-cms etc
I have got it to load editor but not "CMS - Edit" or "Add-ons" with the following changes, I also pointed the clientResourceRelativePath to newer version number?
The site was built on the Alloy MVC templates and has been modified since, so need help to get upgrade to 7.1
Will try this solution for Alloy MVC and will update thread if it works for me.
http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=69836&epslanguage=en
It now works by copying files from
Run an IIS reset from command prompt, then remove files from
Start site.
Hey All,
I've been having various issues with upgrading to 7.1 (and i apologize for the influx of forum posts). The problem i'm trying to solve at the moment is getting my custom dojo initialize module (that was working in 7) to load. After some testing it appears that the module.config file i've placed in my site root is not being loaded anymore? I was using this to register some dojo namespace mappings so my command plugins would load.
After the 7.1 upgrade, I took a look at the module.config placed in the Modules/CMS folder to see if there was any changes I would need to make - what i noticed is it appears the <dojoModules> node is removed and replaced with <dojo> and then <paths> inside the dojo tag. So i modifed my module.config in my site root to use the same layout. The problem still exists where it is not loading any of my js files (as it was before) - The only thing I can assume is that the module.config in my site root is no longer being used and/or loaded for some reason.
Any thoughts?