Umbraco-cms: V8: Multi content picker as Macro parameter is not allowing multiple items to be selected

Created on 9 Apr 2019  路  8Comments  路  Source: umbraco/Umbraco-CMS

When you select a Multi content picker as Macro parameter and then attempt to use this within a macro, it only allows you to select one item.
Checking the model output, you can see that the 'multiPicker' property within the model is false.

Reproduction

Specifics

Version 8.0.1

Steps to reproduce


1) Create a new macro(or edit an existing one)
2) Add a parameter and set the 'Editor' value as 'Multi content picker'
3) Save
4) Go to a view and insert a macro, then select your test one
5) Select a content node and you've been taken back to the parameters overview for the macro without the option to add more content nodes

Tried this on a fresh instance of 8.0.1 and also pulled the source code, built and tested on the current version which also suffers from the same issue.

Exposing the model.config value in the editor view, I get the following:
{"multiPicker":false,"showOpenButton":false,"showEditButton":false,
"showPathOnHover":false,"maxNumber":1,"minNumber":0,"startNode":{"query":"","type":"content","id":-1}}

Expected result

Being able to select multiple nodes

Actual result

Only able to select one node, without the option to add more.

communitpr releas8.1.0 typbug

All 8 comments

Thanks for reporting, have marked as up for grabs to see if the community might be able to assist.

Np @Shazwazza, more than happy to help where I can.

It also looks like the other 'multiple picker' type editors for macro parameters may be affected by the same issue. I've just tried adding the 'Multiple Content Type Picker', 'Multiple Property Type Picker' and the 'Multiple Tab Picker' which all only allow me to select one item instead of many?

More than happy to have a look at fixing these issues tonight if someone can point me in the direction of where I might need to look please?

I have also encountered this problem and are looking for a solution.

I think I've found the problem @Shazwazza.
It looks like the default mapping is being ignored by AutoMapper(I think you still use this?) when the action method 'GetMacroParameters' is being called.
When I inspected the 'Configuration' property for the multi picker Macro Parameter it was an empty collection, instead of being populated with the defaults.

I think I've seen an update/ pull requests from @zpqrtbnk for the auto mapper which may correct this?

In 8.1 we no longer have AutoMapper and mapping is done internally with our own logic (but the mapping calls look the same). Are you using the code from the latest v8/dev branch? If so, you'll probably want to look into where this mapping logic occurs which i think is in: MacroMapDefinition

I've been digging into this and I think I have a fix 馃憤

PR in #5278

Was this page helpful?
0 / 5 - 0 ratings