- Issue created by @kunal.sachdev
- First commit to issue fork.
- Status changed to Needs review
7 months ago 12:56pm 30 April 2024 - Status changed to RTBC
7 months ago 1:33pm 30 April 2024 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
Committed and pushed 93682028b4 to 11.x and f12a516b4f to 10.3.x. Thanks!
-
alexpott โ
committed f12a516b on 10.3.x
Issue #3440975 by kunal.sachdev, phenaproxima: Add validation...
-
alexpott โ
committed f12a516b on 10.3.x
- Status changed to Fixed
7 months ago 2:31pm 30 April 2024 -
alexpott โ
committed 93682028 on 11.x
Issue #3440975 by kunal.sachdev, phenaproxima: Add validation...
-
alexpott โ
committed 93682028 on 11.x
- Status changed to RTBC
7 months ago 6:07pm 30 April 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I have to disagree with #5. ๐ ๐
This marked
system.mail
as fully validatable, but it did not change:interface: type: sequence label: 'Interfaces' sequence: type: string label: 'Interface'
โฆ meaning literally any string is accepted, whereas AFAICT it must be a valid
@Mail
plugin ID? See\Drupal\Core\Mail\MailManager::getInstance()
.Similarly,
mailer_dsn
'sscheme
andhost
should probably also be validated but currently aren't.The key-value pairs under
mailer_dsn
are trickier/more questionable though, but the mail interfaces are a clear omission. -
alexpott โ
committed a003b4ec on 11.x
Revert "Issue #3440975 by kunal.sachdev, phenaproxima: Add validation...
-
alexpott โ
committed a003b4ec on 11.x
- Status changed to Needs work
7 months ago 6:16pm 30 April 2024 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
@Wim Leers great points. Reverted.
-
alexpott โ
committed 124e4d66 on 10.3.x
Revert "Issue #3440975 by kunal.sachdev, phenaproxima: Add validation...
-
alexpott โ
committed 124e4d66 on 10.3.x
- ๐ฎ๐ณIndia kunal.sachdev
For #9 ๐ Add validation constraints to system.mail Needs work we already have a constraint
constraints: PluginExists: manager: plugin.manager.mail interface: 'Drupal\Core\Mail\MailInterface'
to check if the plugin name is valid.
- Status changed to Needs review
6 months ago 7:46am 8 May 2024 - Status changed to Needs work
6 months ago 3:08pm 8 May 2024 - First commit to issue fork.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Discussed with Wim and we were looking at https://symfony.com/doc/current/reference/constraints/AtLeastOneOf.html, as hostname could be a hostname, a ipv4 or a ipv6. After some pairing we figured out that using composite constraints might be complex and could be deferred to a follow-up, as it's not very common to use a IP for a mail server hostname.
However, back at home just discovered the Symfony "Hostname" validator will consider "default" as an invalid one, and that's our default for e.g. when using sendmail, so we really need to figure this out here.
- ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
Gave it a try and I think I ended up in the same place I ended up on Wim's computer.
Created https://git.drupalcode.org/issue/drupal-3440975/-/merge_requests/1/diffs for not polluting the original MR. I got stuck when in some place we are expecting typed data instead of the underlying value (or the opposite). Might be easier if we just extend from the symfony validators (as Regex does already), but definitely not as clean :-/
- ๐จ๐ญSwitzerland znerol
Oops, did some work in parallel on
system.mail.mailer_dsn
over in ๐ Tighten config validation schema of system.mail mailer_dsn Fixed . - ๐ช๐ธSpain penyaskito Seville ๐, Spain ๐ช๐ธ, UTC+2 ๐ช๐บ
@WimLeers this should probably closed as duplicated, but do you think is worth opening another issue for trying to reuse the symfony validators OOTB. specially for those like AtLeastOneOf?
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Nice, ๐ Tighten config validation schema of system.mail mailer_dsn Fixed landed while I was on vacation, so โฆ I agree this can be closed.
I do think it would be superb to create a new issue for adopting
AtLeastOneOf
! (I lost track of it after pairing with you on getting that to work at DrupalCon Portland, @penyaskito ๐ โ been too occupied with https://wimleers.com/tags/experience-builder.)Could you open that? ๐ And perhaps share/describe what the challenges are in adopting that?
- ๐จ๐ญSwitzerland znerol
Follow-up: ๐ Remove the restriction from RecursiveContextualValidator that prevents using custom groups. Needs review .
- ๐ฎ๐ณIndia kunal.sachdev
I also tried to use
AltLeastOneOf
constraint in ๐ Add validation constraints to core.menu.schema.yml Needs work and I have mentioned the problems I faced in https://www.drupal.org/project/drupal/issues/3441434#comment-15686742 ๐ Add validation constraints to core.menu.schema.yml Needs work .