plone / plone/mockup

"Upload to..." impossible in containers of type other than 'Folder'

Open
#1,270 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
57
Forks
103
Avg merge
10h 25m
Merged PRs (30d)
18

Description

Bring here this: https://community.plone.org/t/tinymce-upload-file-to-containers-other-than-folder-large-plone-folder-plone-site-impossible/16135/2

The problem is that selectableTypes are defaulted to ['Folder'] here

https://github.com/plone/mockup/blob/c31dcf0b106bc3a6081eba2c036a9618ad8e837b/src/pat/upload/upload.js#L49

IMHO, it would be nice either of this two options:

  1. let the used related items pattern look for some generalist interface like IPrincipiaFolderish as suggested by @petschki (https://community.plone.org/t/tinymce-upload-file-to-containers-other-than-folder-large-plone-folder-plone-site-impossible/16135/3?u=sauzher)
  2. get selectableTypes be parametrized so that a consumer (for ex. TinyMCE template) could pass its specific configuration via data-pat-upload. Actually TinyMCE has Products.CMFPlone.interfaces.controlpanel.ITinyMCESchema.plone.contains_objects configuration registry option that seems to fit quite well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/pat/upload/upload.js around line 49, then inspect the related items pattern and the TinyMCE template's data-pat-upload configuration. Compare the IPrincipiaFolderish suggestion with parameterizing selectableTypes from ITinyMCESchema.plone.contains_objects; done means uploads are available in supported non-Folder containers without breaking existing Folder behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.