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
In #3060996: Fix The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead. we added a skipped deprecation that was triggered by behat/mink-browserkit-driver.
Since then behat/mink-browserkit-driver has released a new version that should remove the deprecation warning.
Proposed resolution
Remove the skipped deprecation.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#9 | interdiff-2-9.txt | 837 bytes | sja112 |
#9 | 3135308-9.patch | 1.77 KB | sja112 |
#2 | 3135308.patch | 971 bytes | longwave |
Comments
Comment #2
longwaveComment #4
longwaveRandom fail.
Comment #6
Kristen PolThanks for the patch.
1) I don't see anything wrong with the patch. I read the issue summary in #3060996: Fix The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead. and reviewed the commit https://git.drupalcode.org/project/drupal/commit/74e4b5d which added:
I compared this code with the code being removed in the patch and it's identical.
2) Patch applied cleanly to 9.0 and 9.1.
3) The issue summary says:
The patch from #3060996: Fix The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead. was committed 11 August 2019 at 17:25.
Versions of
behat/mink-browserkit-driver
are:1.3.4 - 2020-03-11 09:49 UTC
1.3.3 - 2018-05-02 09:25 UTC
I'm unclear where this is fixed. I see the same
getStatus()
andgetStatusCode()
calls in both versions. I assume I don't understand something obvious here.Comment #7
narendra.rajwar27Comment #8
Kristen Pol@narendra.rajwar27 If you aren't able to get to finish updating an issue within a few hours, it's best to unassign it so others might work on it. Thanks.
Comment #9
sja112 CreditAttribution: sja112 at Srijan | A Material+ Company for Drupal India Association commentedI have updated the patch to fix
This deprecation is not added in the release. I am working on Drupal 9.1.x latest codebase.
Please review.
Comment #10
longwave@Kristen Pol: as always, thanks for the review! Tests will fail if deprecation notices still remain, as happened here - there is one case that was calling getStatus() directly and this caused the test to fail:
If the dependency was calling the old method then more tests would have failed in the same way. If we look at the diff between 1.3.3 and 1.3.4 of behat/mink-browserkit-driver we can see that a fix was added to only call the old method if the new one doesn't exist:
https://github.com/minkphp/MinkBrowserKitDriver/compare/v1.3.3..v1.3.4#d...
@sja112: Thanks for fixing the test failure! Other than removing the deprecation skip, that is the only change that is required here, so this is now RTBC.
Comment #11
alexpottCommitted and pushed ef61d27660 to 9.1.x and 492710b7ab to 9.0.x. Thanks!
Backported to 9.0.x as this is a test-only fix.
Comment #14
Kristen Pol@longwave Thanks for the thoughtful explanation! And to @sja112 for the update! And to @alexpott for the commit! :)