-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for accept attribute on file input. #200
Conversation
@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:
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! |
b13181e
to
f603259
Compare
If the widget's field - if there is one - has the "accept" attribute set (the `NamedImage` field has `image/*` set by default) then this is rendered as an `accept` attribute on the file input. This would restrict the allowed file types before uploading while still being checked on the server side. Fixes: plone/plone.formwidget.namedfile#66 Depends on: - plone/plone.namedfile#158 - plone/plone.formwidget.namedfile#67
f603259
to
c52dd4e
Compare
@jenkins-plone-org please run jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out and it works in combination with the other PRs.
I have added suggestions to add |nothing
so it does not break when this code is used in combination with a field/widget that does not have an accept
attribute. Maybe someone is using this on a field that we do not expect.
With those |nothing
added, the input still works when I try it with an old release of plone.formwidget.namedfile
.
Co-authored-by: Maurits van Rees <[email protected]>
Co-authored-by: Maurits van Rees <[email protected]>
Co-authored-by: Maurits van Rees <[email protected]>
Co-authored-by: Maurits van Rees <[email protected]>
I have released a new But the dependencies check fails. Should have nothing to do with this PR. I am on it, trying an update with |
z3c.dependencychecker says this dependency is not needed, but it is wrong: it is used in widgets.zcml.
All GitHub Actions pass. Now try Jenkins again: @jenkins-plone-org please run jobs |
If the widget's field - if there is one - has set (the field has set by default) the allowed content types are rendered as attribute on the file input.
This already restricts the allowed file types before uploading while still being checked on the server side too.
Fixes: plone/plone.formwidget.namedfile#66 Depeds on: