Running on Drupal Core 9.0 there is one deprecation message:
1x: Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated and defaults to true. In 5.0, it will become optional and default to false.
This is produced by TextareaWidgetTest::testValidation in Drupal\Tests\typed_data\Functional\TypedDataFormWidget
I don't know if there is anything that we can do about this? If it is unavoidable I can set SYMFONY_DEPRECATIONS_HELPER=1 when running at core 9.0 so that the test passes, but more importantly I am alerted if/when the job next fails, as that will mean a new deprecation has occurred.
Comments
Comment #2
jonathan1055 commentedThe test in question has
I will investigate adding the "allowEmptyString" option.
Comment #3
jonathan1055 commentedI tried adding
->addConstraint('Length', ['min' => 40, 'allowEmptyString' => FALSE]).At core 8.8 and 8.9 this gives the error
Symfony\Component\Validator\Exception\InvalidOptionsException: The options "allowEmptyString" do not exist in constraint "Drupal\Core\Validation\Plugin\Validation\Constraint\LengthConstraint". in Symfony\Component\Validator\Constraint->__construct()This was using Symfony 3.4.
Running tests at core 9.0 work fine, there is no deprecation warning, and they all pass. This was using symfony 4.4
I also found #3117863: [Symfony 5] Using the "Symfony\Component\Validator\Constraints\Length" constraint with the "min" option without setting the "allowEmptyString" one is deprecated which dealt with the problem in Core 9.0 and 9.1
Comment #4
jonathan1055 commentedThis can be fixed, but first to demonstrate the existing behavior here's a patch which adds drupalci.yml with
suppress-deprecations: falseComment #5
jonathan1055 commentedThat was a bit tedious, but I finally got the right job config for core 9.0 (php7.3 MySql 5.7), and we can see that there are 59 passes and 1 failure, as expected.
Here is a patch which uses the
version_compare(\Drupal::VERSION, '9.0', '>=')to make the necessary distinction. I know that these types of hack are not ideal, but it will allow the tests at 9.0 to run without deprecated warnings.Comment #6
jonathan1055 commentedThat's nice, we have green at 8.8 and 9.0.
I confirm that this also runs with zero deprecation on the Travis builds at core 9.0
Comment #7
jonathan1055 commentedSo here is the actual patch for review and commit, without the temporary addition of drupalci.yml
Comment #9
tr commentedCommitted. Thanks!