Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
This bug came out in #2770921: Feb 21st: Convert chunk of WTB to BTB by just moving classes, changing use statements adding traits.
TL;DR Mink and Symfony cannot search for elements that contain a pipe ('|') in locator value.
See
https://github.com/minkphp/Mink/pull/720
https://github.com/symfony/symfony/pull/20229
Proposed resolution
If they will fix this upstream, just refresh composer.lock
Otherwise, decide a workaround.
Remaining tasks
Fix Symfony.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#22 | mink-pipes-2808085-22.patch | 8.48 KB | klausi |
Comments
Comment #2
claudiu.cristeaComment #3
dawehnerShould we introduce a workaround to not use pipe operators in random strings for now?
Comment #5
mpdonadio#3, would this cause a regression where we explicitly need pipes? Option value/label pairs come to mind.
Comment #6
claudiu.cristeaWhere we need pipes, we explicitly add them. Random string generator doesn't guarantee a pipe.
Comment #7
klausiComment #8
klausiWhile we wait on feedback in the upstream project I have forked Mink on Github and included that in our PHPUnit initiative feature branch https://github.com/klausi/drupal/commit/9db23a28bfb26ca1bf82e95e5fd6d157...
Comment #9
claudiu.cristeaGreat that https://github.com/minkphp/Mink/pull/720 was merged. But we still have to wait for a new release. I guess, commit pinned versions are not allowed in our composer.json (?)
EDIT: The last version 1.7.1 was released in March, so I guess a new one should be under way.
Comment #10
klausiWe can just pin the recent commit in the meantime.
Comment #11
claudiu.cristeaYes but let's include the test from #2
Comment #12
klausiRight.
Comment #14
klausiArgl, the tests are failing because the Symfony Crawler class has the same problem as Mink. We use the Symfony Crawler in the Goutte Driver backend of our browser tests. See https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Dom...
So we will also have to patch Symfony :(
Comment #15
klausiI will try to come up with a pull request against Symfony copying the approach from Mink.
Comment #16
claudiu.cristeaPff... I missed that :(
Comment #17
klausiSymfony issue: https://github.com/symfony/symfony/pull/20229
Comment #18
klausiThe issue for symfony got committed, so this should now finally pass.
Comment #19
claudiu.cristeaHm. I don't think we can commit this to core. These are not even pinned to a commit. So, if somebody will run composer update on his project will get new unstable versions. Do we have some policy in place related to composer.json?
Comment #20
klausiThe versions are exactly pinned in composer.lock. I think it is fine to commit this for now n 8.3.x until a new stable version of Mink and Symfony is released and then update to that in composer.json.
If you run composer update you will get many updates right now anyway.
Comment #21
jmuzz CreditAttribution: jmuzz commented+1 for committing it now with @klausi's plan.
INSTALL.txt does instruct git users to use composer install. UPDATE.txt doesn't have corresponding instructions for people using git to obtain drupal. Perhaps as a followup instructions could be added to UPDATE.txt explaining that composer install should be used after pulling new code and not composer update. That way people won't end up using versions that weren't tested against drupal core. I have been using composer update until now though and it hasn't been causing me any problems.
Comment #22
klausiSymfony dom crawler has been released.
Comment #23
klausiOpened https://github.com/minkphp/Mink/issues/725 to get a Mink release.
Comment #24
claudiu.cristeaLooks good.
Comment #27
catchDo we use dom-crawler anywhere other than testing? If so it could move to require-dev maybe - not an issue having dev versions there.
I agree this is OK for 8.3.x though, let's make sure we update both once there are tagged releases.
I added commit credit for stof and nicolas.grekas here too.
Comment #29
dawehnerI'm quite happy how Drupal more and more fixes stuff upstream. Thank you a lot @klausi and @claudiu.cristea
Comment #31
xjm