1

Im not sure if Im missing something here.. but when I create a new data-type called Single Media Picker in umbraco 7 and uses the new Media Picker-property editor and keep the "multiple selections option" unchecked.. I am still able to select multiple images in the media picker-dialog..and once selected.. they all show up in my property-filed as well.. any ideas of why?.. guess its a bug in Umbraco.. and if thats the case.. anyone have a clue of how to limit the media-picker to a single selection for my own custom property editor?

Thanks in advance!

Inx
  • 2,364
  • 7
  • 38
  • 55
  • I think there is a bug with this new media picker. I tried the exact same thing. But I first saved the new single media picker with the select multiple checkbox checked. After that I saved the media picker again and this time the picker does allow only one media item to be selected. If anyone can confirm this behaviour, I will post a bug report and share the link here. – twildeman May 13 '14 at 18:22
  • It was a bug and it has been fixed in version 7.1.2. [link to bugreport](http://issues.umbraco.org/issue/U4-4626) – twildeman May 14 '14 at 10:14

1 Answers1

0

It depends a bit on how you use the media picker in your custom property editor. We're using the media picker in a completely separate tree for which we generate the JSON that yields the editor ourselves.

The property data that generates a single item picker looks a bit like this:

{
    "label" : "Some Image",
    "description" : "423 x 258px",
    "view" : "mediapicker",
    "config" : {
        "multiPicker" : "0"
    },
    "hideLabel" : false,
    "id" : 4,
    "value" : "1092",
    "alias" : "imageIdProperty"
}

Notice the config section. You could try to inspect the data that goes to the client and see what JSON is used to generate your picker.

Robba
  • 7,684
  • 12
  • 48
  • 76