Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix drag'n'drop asset when using elementSelect #3590

Merged
merged 2 commits into from
Jan 7, 2019

Conversation

nstCactus
Copy link
Contributor

This allows passing the asset field id to the elementSelect form component, which is needed to determine where to store assets uploaded via drag'n'drop.

Without this fix, dropping an image on an elementSelect component defined like this would result in an error:

{{ forms.elementSelect({
    name: 'desktopImage',
    elements: value.desktopImage.all(),
    sources: asset.sources,
    criteria: { kind: asset.allowedKinds },
    jsClass: 'Craft.AssetSelectInput',
    elementType: 'craft\\elements\\Asset',
}) }}

Error:

The field provided is not an Assets field

This allows passing the asset field id to the elementSelect form component, which is needed to determine where to store assets uploaded via drag'n'drop.
@andris-sevcenko andris-sevcenko merged commit b3b2717 into craftcms:develop Jan 7, 2019
@andris-sevcenko
Copy link
Contributor

Thanks for this!

brandonkelly added a commit that referenced this pull request Jan 7, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants