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

[TwigBridge] Provide a default non-empty label on empty options to validate HTML5 #48035

Open
wants to merge 1 commit into
base: 7.1
Choose a base branch
from

Conversation

DocFX
Copy link
Contributor

@DocFX DocFX commented Oct 28, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

As described on https://rocketvalidator.com/html-validation/element-option-without-attribute-label-must-not-be-empty, so far this template generates empty options with no value, no content, and no label. This is not a break, but a simple "should".

Not sure how we should recommend handling this, users have the possibility to handle this themselves (https://symfony.com/doc/current/reference/forms/types/choice.html#placeholder), but if they don't we leave a non-stadanrd-compliant output.

The tailwind template is also affected from this, as it extends this one.

I proposed a double-dash default value:

  • pretty affordant
  • doesn't use translations as users might not use them
  • doesn't suffer from language dependent doubtful meaning

I locally fix this by overriding the default templates, but I thought the default ones could get a fix.

(NB: this is just a new PR for #44464, as previous one was merged in haste and reverted, with tests up to date this time)

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

@DocFX DocFX force-pushed the patch-5 branch 11 times, most recently from 4cf75e6 to c09ab9b Compare October 29, 2022 00:00
@DocFX DocFX marked this pull request as ready for review October 29, 2022 00:08
@carsonbot carsonbot added this to the 6.2 milestone Oct 29, 2022
@DocFX
Copy link
Contributor Author

DocFX commented Oct 29, 2022

Remaining broken tests (cache & doctrine) seem to have nothing to do with this PR. Not sure I can help with that on that one.

@DocFX
Copy link
Contributor Author

DocFX commented Oct 29, 2022

@nicolas-grekas this should be a follow-up to #44464 if I got everything right. :)

@carsonbot
Copy link

Hey!

I think @alexander-schranz has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

The failures on the deps=low job look related.

@DocFX
Copy link
Contributor Author

DocFX commented Oct 31, 2022

The failures on the deps=low job look related.

Oh gosh, you're completely right, I went too fast and forgot some tests XD
Thanks @xabbuh!

@DocFX
Copy link
Contributor Author

DocFX commented Oct 31, 2022

I have a HUGE cache problem with Github... When I look at the tests here it says they're broken, even with force-refresh, no cache in browser, and with I go to "actions" page to see details, tests are OK.

Can anyone help and tell me what they see? XD

@xabbuh
Copy link
Member

xabbuh commented Nov 1, 2022

@derrabus
Copy link
Member

derrabus commented Nov 1, 2022

Please find a PR description that tells me what the PR does. The PR description will be used as a change log entry.

@DocFX DocFX changed the title [TwigBridge] (Simple new branch for failed PR at #44464) [TwigBridge] Provide a default non-empty label on empty options to validate HTML5 Nov 4, 2022
@DocFX
Copy link
Contributor Author

DocFX commented Nov 4, 2022

Please find a PR description that tells me what the PR does. The PR description will be used as a change log entry.

Sure, edited the title and description!

@DocFX
Copy link
Contributor Author

DocFX commented Nov 4, 2022

That's exactly my problem, @xabbuh: this is not my code, and it's not the one from the PR. This job is testing... Something different. I looked at the CI job and couldn't why out why, but I was missing more time to investigate.

https://github.com/symfony/symfony/pull/48035/files#diff-4125508802c9ee9145cb3e5f9c6742dad7c084623d03442c38b7cba10b8c8f09

@DocFX DocFX force-pushed the patch-5 branch 3 times, most recently from 53d7b5d to 80ec9fc Compare November 4, 2022 14:41
@DocFX
Copy link
Contributor Author

DocFX commented Nov 4, 2022

(meanwhile, someone fixed the "Integration / Tests (8.1) (pull_request)" job, so this one now passes :) )

@nicolas-grekas nicolas-grekas modified the milestones: 6.2, 6.3 Nov 5, 2022
@nicolas-grekas nicolas-grekas modified the milestones: 6.3, 6.4 May 23, 2023
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 7.1 Nov 15, 2023
@xabbuh xabbuh modified the milestones: 7.1, 7.2 May 15, 2024
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.

None yet

5 participants