Press Ctrl / CMD + C to copy this to your clipboard.
Copied to clipboard
Flag this post as spam?
This post will be reported to the moderators as potential spam to be looked at
Topic author was deleted
Dec 19, 2013 @ 18:51
Umb 7 Property editor controller not updating
Not sure what I'm doing wrong.
But I've built a controller for a property editor and it worked great the first time.
However when I updated the editor during development, the changes do not appear.
I've cleared caches, touched the web.config, etc.
The only thing that works is to rename the controller.js file, update the manifest and touch the web.config after each edit. Obviously that isn't very productive.
Is there any other way to fix this issue? Forcing it to reload/Re-cache?
Sometimes you have a live site, where you need to make some editor changes and make it accessible to the customer asap ( in this case changing debug=”true” will not be a good solution)
I'm not sure how I suppose to do it in my case - I made some changes in umbraco.controller.js - each time you Save and Publish I want to run a reindex of the news. The thing is, it does not enter 'IndexNews()' - unless i set debug="true"
$scope.saveAndPublish = function () {
var message = performSave({ saveMethod: contentResource.publish, statusMessage: "Publishing..." });
IndexNews();
return message;
};
function IndexNews() {
var contentType = $scope.content.contentTypeAlias;
If you are trying to trigger some code when content is saved/published then you're better off creating an EventHandler to trigger your code in the backend rather than trying to modify the umbraco.controller.js.
If that's the case, start a new thread as the solution probably doesn't belong here.
Thank you very much for your answer. I made a thread about registering events in Umbraco. But this is still an issue. I have another sample:
I installed UTagy, in the controller uTagsyEditor.controller.js I found “console.log($scope.model.value)” - This code I removed. But if I don’t turn debug=true it still writes it in the console…Somehow I should be able to force everything to reload / re-cache when i make changes to a controller.
If you've modified the javascript file in a plugin in App_Plugins, modify the package.manifest file for that plugin (I add a version string to the end of the url of the javascript file I've modified).
Otherwise, edit the ClientDependency.config file and increment the serial number in there. that generally forces a refresh of the cache
If that doesn't help, touch the web.config file as well.
The way I got around this... kind of around the bush, but I take advantage of something.
Umbraco requires "ProcessForAllRequests" to be try on the modules section... Which means all managed HttpModules fire for every request, including static files (if the static file wasn't found by the static file handler).
So what I did is I created an HttpHandler to serve up my package.manifest file, meaning I don't store it in App_Plugins.
I created a VirtualPath Provider to serve up my package on the AppPlugins Url. So when it sees AppPlugins/MYPACKAGE the virtual path provider handles it and everything under it.
Then I store my package manifest, html angular views, and javascript files as embeded resource in my dll. (This means simply referencing my dll installs the package basically, as there are no files that need to go anywhere, they are embeded, and removing the dll uninstalls it basically).
However when a request asks for package.manifest, I replace {{ver}} anywhere in the package.manifest file with the tickcount of the last modified date of the dll (via reflection).
So in my package manifest anywhere I have something I want to recache when I rebuild, I just add {{ver}} like '~/App_Plugins/MyPackage/PropertyEditors/XYZUserPicker/XYZUserPicker-controller.js?ver={{ver}}'
The downside to itis I have to build to do a refresh which requires an app pool recycle. However if the package.manifest is not cached, meaning it gets requested each time you hit the back office (page refresh etc, I could come up with a solution to that)
Personally though I love not storing my stuff on disk in a dll, as a package I think it makes perfect sense as well because it self contains it, and theres nothing to install/uninstall (file wise) it's super clean.
Hi,
I was struggling with this issue, and just wanted to say this answer helped. I simply disabled cache in the google chrome developer settings, and now I see my changes again.
I found the updated changes showed in a different browser (Edge) but not my development browser (Chrome).
Clearly a browser issue, but triggering a hard refresh (Ctrl+F5) didn't resolve the issue. Going to the Development Tools (F12) then Network tab and selecting Disable cache worked.
Topic author was deleted
Umb 7 Property editor controller not updating
Not sure what I'm doing wrong.
But I've built a controller for a property editor and it worked great the first time.
However when I updated the editor during development, the changes do not appear.
I've cleared caches, touched the web.config, etc.
The only thing that works is to rename the controller.js file, update the manifest and touch the web.config after each edit. Obviously that isn't very productive.
Anyone know how to overcome this?
I'm interested in this as well.
My current work around is to add a querystring to the controller file name within the manifest.
Pretty annoying though
Comment author was deleted
I see the DependencyHandler.axd is where the code is living while cached.
I'll see about opening an issue at issues.umbraco.org.
Comment author was deleted
Are you generating a dynamic query string to bust the cache?
Comment author was deleted
Ok here's the fix:
web.config...
Set debug to TRUE while developing. This prevents the minification.
Also need to clear your browser cache each time.
Doh!
Wished I had raised this 2 weeks ago...
Thanks Kevin!
Is there any other way to fix this issue? Forcing it to reload/Re-cache?
Sometimes you have a live site, where you need to make some editor changes and make it accessible to the customer asap ( in this case changing debug=”true” will not be a good solution)
@prinzie - you could do what I did previously and add a cache busting querystring to the javascript url. Does that not work?
I'm not sure how I suppose to do it in my case - I made some changes in umbraco.controller.js - each time you Save and Publish I want to run a reindex of the news. The thing is, it does not enter 'IndexNews()' - unless i set debug="true"
$scope.saveAndPublish = function () {
var message = performSave({ saveMethod: contentResource.publish, statusMessage: "Publishing..." });
IndexNews();
return message;
};
function IndexNews() {
var contentType = $scope.content.contentTypeAlias;
if (contentType == "News") {
$http({ method: 'GET', url: '/umbraco/api/IndexNewsApi/IndexAllNewsNow' }).
success(function (data, status, headers, config) {
}).
error(function (data, status, headers, config) {
});
}
}
Hi prinzie,
If you are trying to trigger some code when content is saved/published then you're better off creating an EventHandler to trigger your code in the backend rather than trying to modify the umbraco.controller.js.
If that's the case, start a new thread as the solution probably doesn't belong here.
- Rob.
Hi Robert
Thank you very much for your answer. I made a thread about registering events in Umbraco. But this is still an issue. I have another sample:
I installed UTagy, in the controller uTagsyEditor.controller.js I found “console.log($scope.model.value)” - This code I removed. But if I don’t turn debug=true it still writes it in the console…Somehow I should be able to force everything to reload / re-cache when i make changes to a controller.
There's a couple of things you can do.
If you've modified the javascript file in a plugin in App_Plugins, modify the package.manifest file for that plugin (I add a version string to the end of the url of the javascript file I've modified).
Otherwise, edit the ClientDependency.config file and increment the serial number in there. that generally forces a refresh of the cache
If that doesn't help, touch the web.config file as well.
The way I got around this... kind of around the bush, but I take advantage of something.
Umbraco requires "ProcessForAllRequests" to be try on the modules section... Which means all managed HttpModules fire for every request, including static files (if the static file wasn't found by the static file handler).
So what I did is I created an HttpHandler to serve up my package.manifest file, meaning I don't store it in App_Plugins.
I created a VirtualPath Provider to serve up my package on the AppPlugins Url. So when it sees AppPlugins/MYPACKAGE the virtual path provider handles it and everything under it.
Then I store my package manifest, html angular views, and javascript files as embeded resource in my dll. (This means simply referencing my dll installs the package basically, as there are no files that need to go anywhere, they are embeded, and removing the dll uninstalls it basically).
However when a request asks for package.manifest, I replace {{ver}} anywhere in the package.manifest file with the tickcount of the last modified date of the dll (via reflection).
So in my package manifest anywhere I have something I want to recache when I rebuild, I just add {{ver}} like '~/App_Plugins/MyPackage/PropertyEditors/XYZUserPicker/XYZUserPicker-controller.js?ver={{ver}}'
The downside to itis I have to build to do a refresh which requires an app pool recycle. However if the package.manifest is not cached, meaning it gets requested each time you hit the back office (page refresh etc, I could come up with a solution to that)
Personally though I love not storing my stuff on disk in a dll, as a package I think it makes perfect sense as well because it self contains it, and theres nothing to install/uninstall (file wise) it's super clean.
Just need to clear the browser cache. It just works fine after this.
Thanks
Hi, I was struggling with this issue, and just wanted to say this answer helped. I simply disabled cache in the google chrome developer settings, and now I see my changes again.
I found the updated changes showed in a different browser (Edge) but not my development browser (Chrome).
Clearly a browser issue, but triggering a hard refresh (Ctrl+F5) didn't resolve the issue. Going to the Development Tools (F12) then Network tab and selecting Disable cache worked.
is working on a reply...