Copied to clipboard

Flag this post as spam?

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


  • Brad 69 posts 97 karma points
    Dec 05, 2017 @ 18:14
    Brad
    0

    MultiNodeTreePicker2 Issue

    About 50% of the time when I select something from the tree picker, and hit submit, it doesn't show as the values having been selected on the content page. If I save and refresh they aren't saved. So I have to keep clicking "Add" and checking the items and clicking submit until it sticks. Any ideas? This is Umbraco 7.7.4

  • Brad 69 posts 97 karma points
    Dec 05, 2017 @ 18:23
    Brad
    0

    Here is a video: https://youtu.be/Id802KpkmQ4

  • Brad 69 posts 97 karma points
    Dec 05, 2017 @ 18:53
    Brad
    0

    Seems to be a timing issue in function contentPickerController in umbraco.controller.js

    $scope.contentPickerOverlay.submit = function (model) {
                console.log(model.selection.length.toString());
                console.log(model.selection);
    
                if (angular.isArray(model.selection)) {
                    _.each(model.selection, function (item, i) {
    
                        console.log("each item");
    
                        $scope.add(item);
                    });
                }
                $scope.contentPickerOverlay.show = false;
                $scope.contentPickerOverlay = null;
            };
    

    If I log the length it's 0, but the actual object clearly has more than 0. So somehow model.selection doesn't have the element until after the for loop, so it never iterates over them. Seems like a timing issue.

    Edit: after more research it seems like entityResource.getByIds hasn't fully completed so if you hit submit too fast the IDs haven't even been looked up from REST.

Please Sign in or register to post replies

Write your reply to:

Draft