Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support for allowed content types. (Branch for 5.x) #159

Merged
merged 5 commits into from Mar 15, 2024

Conversation

thet
Copy link
Member

@thet thet commented Mar 15, 2024

Support to constrain files to specific content types with a "allowedContentTypes" attribute on file and image fields.

Fixes: #157

BRANCH‌ FOR 5.x / Plone 5.x

Related: #158

Support to constrain files to specific media types with a "accept" attribute on
file and image fields, just like the "accept" attribute of the HTML file input.

Fixes: #157
Change get_contenttype to support common types which are or were not registered
with IANA, like image/webp or audio/midi.

Note: image/webp is already a IANA registered type and also added by
Products.MimetypesRegistry.
@mister-roboto
Copy link

@thet thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@thet
Copy link
Member Author

thet commented Mar 15, 2024

@jenkins-plone-org please run jobs

1 similar comment
@thet
Copy link
Member Author

thet commented Mar 15, 2024

@jenkins-plone-org please run jobs

@thet thet force-pushed the allowed_content_types--5.x branch from 10a6d54 to a38d765 Compare March 15, 2024 10:44
@thet
Copy link
Member Author

thet commented Mar 15, 2024

@jenkins-plone-org please run jobs

Mostly I want to trigger the pre-commit tests to run again.
@mauritsvanrees
Copy link
Sponsor Member

I am testing this together with plone/plone.formwidget.namedfile#68 on Jenkins on Plone 5.2.

But it is a bit late to add new features to Plone 5.2, which is already officially unmaintained. I am happy with the feature though, so let's do this:

  • For plone.namedfile create branch 5.6.x.
  • For plone.formwidget.namedfile create branch 2.1.x.
  • Change buildout.coredev branch 5.2 to use these new branches.
  • Merge the PRs (when green) to the original branches.
  • Release new versions and add them in newer-versions.cfg, which is not used or tested, but serves as a central place to put newer versions that we think are fine but that we do not want to include in 5.2 officially.

I will make branches.

@mauritsvanrees
Copy link
Sponsor Member

There are two robot test failures on 2.7, but they seem unrelated. I merge the two PRs.

@mauritsvanrees mauritsvanrees merged commit fce90e0 into 5.x Mar 15, 2024
3 of 4 checks passed
@mauritsvanrees mauritsvanrees deleted the allowed_content_types--5.x branch March 15, 2024 16:11
@mauritsvanrees
Copy link
Sponsor Member

plone.namedfile 5.7.0 and plone.formwidget.namedfile 2.2.0 are out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants