Copied to clipboard

Flag this post as spam?

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


  • Josef Henryson 24 posts 98 karma points
    Sep 12, 2022 @ 15:22
    Josef Henryson
    0

    MultiUrlPicker angular directive not working in 10.2.0

    Hi,

    I have a custom property editor (in App_Plugins) with a property for picking a tree node or entering a URL in text field. It seems to have stopped working in version 10.1.0. I can pick a node and it shows up in the backoffice UI, but after publishing the page it is empty / not set. Here is my code:

    <umb-property-editor id="teaserLink" model="multiurlpicker" />
    
    $scope.multiurlpicker = {
        editor: "Umbraco.MultiUrlPicker",
        view: 'multiurlpicker',
        config: {
            minNumber: 0,
            maxNumber: 1
        },
        value: $scope.model.page
      }
    
    $scope.$watch('multiurlpicker.value', function (newValue, oldValue) {
        if (angular.equals(newValue, oldValue)) return
        $scope.model.page = newValue
        $scope.control.value = $scope.model
      })
    

    I tried to add a console.log in my watch but it seems like it is never executed.

    Does anyone manage to get this working and can you confirm it is working in 10.1.0 or later?

    Thanks in advance, Josef

  • Josef Henryson 24 posts 98 karma points
    Sep 14, 2022 @ 16:45
    Josef Henryson
    100

    It seems it was me and myself that caused the bug. Removing this line did the trick:

    if (angular.equals(newValue, oldValue)) return

    I added it in a recent commit in place of a '==' check which apparently was a bad idea.

Please Sign in or register to post replies

Write your reply to:

Draft