Copied to clipboard

Flag this post as spam?

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


  • John Sharp 13 posts 82 karma points
    Jan 25, 2021 @ 15:19
    John Sharp
    0

    I'm reposting this here as I think the previous instance I posted this it might have been in the wrong place.

    enter image description here

    I've been trying to reorder some items inside of a grid editor section, when I start to drag an editor this message appears.

    I've dug into the code and found this:

                over: function over(event, ui) {
                var area = event.target.getScope_HackForSortable().area;
                var allowedEditors = area.allowed;
    
    
                /*if (area.$allowedEditors) {
                    allowedEditors = (allowedEditors ?? []).concat(area.$allowedEditors.map(e => e.alias));
                }*/
    
    
                if ($.inArray(ui.item[0].getScope_HackForSortable().control.editor.alias, allowedEditors) < 0 && allowedEditors || startingArea != area && area.maxItems != '' && area.maxItems > 0 && area.maxItems < area.controls.length + 1) {
                    $scope.$apply(function () {
                        area.dropNotAllowed = true;
                    });
                    ui.placeholder.hide();
                    cancelMove = true;
                } else {
                    if (area.controls.length == 0) {
                        $scope.$apply(function () {
                            area.dropOnEmpty = true;
                        });
                        ui.placeholder.hide();
                    } else {
                        ui.placeholder.show();
                    }
                    cancelMove = false;
                }
            },
    

    The commented out block is a change I've made to get around the issue. From what I was able to see, it looks as though area.allowed is being incorrectly set when the grid rows are being edited and the allow all editors flag is toggled. The values of the area object as presented have .$allowedEditors set correctly with all values that are available but .allowed does not.

    I may be wrong and possibly have incorrectly set up the rows of my grid but I can't tell based on the objects.

    Is this a bug due to something I've done or is it something others are experiencing?

    My thanks,

    John

  • Markus Johansson 1707 posts 4885 karma points c-trib
    Jan 25, 2021 @ 21:14
    Markus Johansson
    0

    Sounds like a bug to me, I would encourage you to post an issue at www.GitHub.com/Umbraco so that this can be reproduced and investigated.

Please Sign in or register to post replies

Write your reply to:

Draft