Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Petr Snobelt 923 posts 1535 karma points
    Feb 19, 2014 @ 14:56
    Petr Snobelt
    0

    Don't work in 7.03

    errors in js console 

    TypeError: Cannot read property 'treeAlias' of undefined
        at http://localhost:83/DependencyHandler.axd?s=L3VtYnJhY28vbGliL2pxdWVyeS9qcXV…HJlZU1lbnUvQWN0aW9uTmV3UmVsYXRpb25UeXBlLmpzOw&t=Javascript&cdv=101:326:222
        at http://localhost:83/umbraco/lib/underscore/underscore.js:153:20
        at Array.some (native)
        at _.some._.any (http://localhost:83/umbraco/lib/underscore/underscore.js:201:59)
        at Function._.find._.detect (http://localhost:83/umbraco/lib/underscore/underscore.js:152:5)
        at doLoad (http://localhost:83/DependencyHandler.axd?s=L3VtYnJhY28vbGliL2pxdWVyeS9qcXV…HJlZU1lbnUvQWN0aW9uTmV3UmVsYXRpb25UeXBlLmpzOw&t=Javascript&cdv=101:326:166)
        at Object.<anonymous> (http://localhost:83/DependencyHandler.axd?s=L3VtYnJhY28vbGliL2pxdWVyeS9qcXV…VHJlZU1lbnUvQWN0aW9uTmV3UmVsYXRpb25UeXBlLmpzOw&t=Javascript&cdv=101:330:59)
        at Object.r (http://localhost:83/umbraco/lib/jquery/jquery-2.0.3.min.js:10:16814)
        at Object.x.event.dispatch (http://localhost:83/umbraco/lib/jquery/jquery-2.0.3.min.js:10:11778)
        at Object.y.handle (http://localhost:83/umbraco/lib/jquery/jquery-2.0.3.min.js:10:7899) 
    
    
    Error evaluating js callback from legacy tree node: ReferenceError: openLogManager is not defined 
  • Robert Mulder 79 posts 272 karma points c-trib
    Feb 27, 2014 @ 13:06
    Robert Mulder
    0

    I have the same issue with a different stacktrace, perhaps it helps in dermining what the problem is

    TypeError: Cannot read property 'treeAlias' of undefined
        at http://localhost:56809/umbraco/js/umbraco.directives.js:1505:50
        at http://localhost:56809/umbraco/lib/underscore/underscore.js:153:20
        at Array.some (native)
        at _.some._.any (http://localhost:56809/umbraco/lib/underscore/underscore.js:201:59)
        at Function._.find._.detect (http://localhost:56809/umbraco/lib/underscore/underscore.js:152:5)
        at doLoad (http://localhost:56809/umbraco/js/umbraco.directives.js:1504:46)
        at Object.<anonymous> (http://localhost:56809/umbraco/js/umbraco.directives.js:1529:29)
        at Object.r (http://localhost:56809/umbraco/lib/jquery/jquery-2.0.3.min.js:10:16814)
        at Object.x.event.dispatch (http://localhost:56809/umbraco/lib/jquery/jquery-2.0.3.min.js:10:11778)
        at Object.y.handle (http://localhost:56809/umbraco/lib/jquery/jquery-2.0.3.min.js:10:7899) 
    

    Note that (at least at first glance) the backend does still work. If I hadn't looked at the console I hadn't even noticed it.

  • Erik Thorén 5 posts 25 karma points
    Mar 05, 2014 @ 10:20
    Erik Thorén
    0

    Hi guys. I got the same error as Robert, pretty much word by word besides localhost, and it occured when I carelessly included bootstrap.min.js. Is there a chance you included a js-library that already existed in your solution?

  • Robert Mulder 79 posts 272 karma points c-trib
    Mar 05, 2014 @ 10:28
    Robert Mulder
    0

    I am using Bootstrap (3.0) for the front end. I'd have to look around, but I highly doubt the reference to the bootstrap.min.js from the front end Bootstrap library ended up in the back end as well.

  • Erik Thorén 5 posts 25 karma points
    Mar 05, 2014 @ 11:17
    Erik Thorén
    0

    I fixed my problem by simply moving bootstrap. I made a mistake by including it in the wrong area. Good luck with your error Robert!

  • Robert Mulder 79 posts 272 karma points c-trib
    Mar 11, 2014 @ 14:46
    Robert Mulder
    0

    I've researched it a bit further and have discovered some things. I have a custom section with tree. The root node of the tree has a simple view html with a controller attached to it. This is my controller:

    angular.module("umbraco")
        .controller('My.Controller', ['$scope', 'navigationService',
            function ($scope, navigationService) {
                navigationService.syncTree({ tree: 'MyTree', path: '-1,R'.split(','), forceReload: false }).then(function (syncArgs) {
                    $scope.currentNode = syncArgs.node;
                });
            }]);
    

    Notice how I attempt to tell the navigationService to sync the tree to a particular path to select the tree node that belongs to the current view.

    What seems to be happening however is that the tree is not yet loaded when this controller is instantiated, because if I change my code to be like this it works:

    angular.module("umbraco")
        .controller('ClubVirtual.Mediaplayers.ListController', ['$scope', 'navigationService',
            function ($scope, navigationService) {
                $scope.treeEventHandler.bind('treeLoaded', function () {
                    navigationService.syncTree({ tree: 'ClubVirtualMediaplayersTree', path: '-1,R'.split(','), forceReload: false }).then(function (syncArgs) {
                        $scope.currentNode = syncArgs.node;
                    });
                });
            }]);
    

    Note how I added a bind to the treeEventHandler to only sync the tree if the tree is loaded.

    While this works, I have two problems with this code:

    1. It doesn't feel right, which generally means I'm not doing it right. Is this really the way I should go about making sure the correct tree node is selected?
    2. If the tree is already loaded the event will not fire and my code will not be called. I have yet to find a way to determine whether the tree has been loaded, so I'm basically just hoping my view is loaded faster than the tree... that's no way to program.

    I've more or less copied this code from default Umbraco controllers, except there the syncTree is added in the callback of a $http request which greatly reduces the likelyhood of the tree not being loaded yet (though it's not theoretically impossible I suppose)

  • Petr Snobelt 923 posts 1535 karma points
    Mar 12, 2014 @ 15:26
    Petr Snobelt
    0

    It looks like it works now (maybe iisreset do the trick)

Please Sign in or register to post replies

Write your reply to:

Draft