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

Fix file type attr #328

Merged
merged 7 commits into from
Apr 30, 2024
Merged

Conversation

RealAestan
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #issuenum
Related issues/PRs #issuenum
License MIT

What's in this PR?

The attribute max is removed on input type file
The attribute accept is removed when there is not restrictions on input file type

Why?

max attr is no only applicable on date month week time datetime-local number range input types
accept attr should not be empty, when all files are accepted the attribute should be removed

max attr is no only applicable on `date` `month` `week` `time` `datetime-local` `number` `range` input types
accept attr should not be empty, when all files are accepted the attribute should be removed
Copy link
Member

@alexander-schranz alexander-schranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the pull request. Little change request.

Comment on lines 81 to 82

$options['attr']['max'] = $fileMax;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this would be a bc break and would crash form themes try to read this attribute to be displayed as value on the website.

At current state we can only add a comment to // @deprecated this and add a line to the UPGRADE.md to remove it in the next major.

For your website you can filter out that attribute in your custom form theme if you don't want to render it.

Copy link
Contributor Author

@RealAestan RealAestan Jul 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, my bad I totally forgot that use case. I added a new "data-max" attribute to allow people who have this use case to have this possibility. Should I add something to UPGRADE.md or let you handle it when you will prepare the release ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah a sentence in the UPGRADE.md would be great about it.

Comment on lines +57 to +59
if (!empty($mimeTypes)) {
$options['attr']['accept'] = \implode(',', $mimeTypes);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alexander-schranz alexander-schranz merged commit 103f299 into sulu:2.5 Apr 30, 2024
4 of 5 checks passed
@alexander-schranz
Copy link
Member

@RealAestan Thank you!

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

Successfully merging this pull request may close these issues.

2 participants