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.

    Anyone know how to overcome this?

  • Stuart Burrows 61 posts 110 karma points
    Dec 19, 2013 @ 18:53
    Stuart Burrows
    0

    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

    Dec 19, 2013 @ 18:58

    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

    Dec 19, 2013 @ 19:01

    Are you generating a dynamic query string to bust the cache?

  • Comment author was deleted

    Dec 19, 2013 @ 19:17

    Ok here's the fix:

    web.config...

     

    <compilation defaultLanguage="c#"debug="true"batch="false"targetFramework="4.5">

    Set debug to TRUE while developing.  This prevents the minification.

    Also need to clear your browser cache each time.

  • Stuart Burrows 61 posts 110 karma points
    Dec 20, 2013 @ 09:11
    Stuart Burrows
    1

    Doh!

    Wished I had raised this 2 weeks ago...

     

    Thanks Kevin!

  • prinzie 13 posts 42 karma points
    Jul 07, 2014 @ 12:08
    prinzie
    0

    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)

  • Stuart Burrows 61 posts 110 karma points
    Jul 07, 2014 @ 12:18
    Stuart Burrows
    0

    @prinzie - you could do what I did previously and add a cache busting querystring to the javascript url. Does that not work?

  • prinzie 13 posts 42 karma points
    Jul 07, 2014 @ 13:02
    prinzie
    0

    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) {

                    });

            }

        }

  • Robert Foster 459 posts 1820 karma points MVP 3x admin c-trib
    Jul 21, 2014 @ 16:04
    Robert Foster
    0

    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.

  • prinzie 13 posts 42 karma points
    Jul 28, 2014 @ 13:52
    prinzie
    0

    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. 

  • Robert Foster 459 posts 1820 karma points MVP 3x admin c-trib
    Jul 28, 2014 @ 13:56
    Robert Foster
    1

    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.

  • Ryios 122 posts 263 karma points
    Feb 09, 2015 @ 23:45
    Ryios
    0

    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.

  • Harsheet 71 posts 302 karma points
    Nov 22, 2016 @ 05:24
    Harsheet
    1

    Just need to clear the browser cache. It just works fine after this.

    Thanks

  • Kasper 13 posts 84 karma points
    Dec 14, 2020 @ 12:21
    Kasper
    0

    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.

  • Anthony 28 posts 147 karma points
    Jul 04, 2017 @ 13:59
    Anthony
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft