Branch tests are failing on all environments with PHP 7.3, due to a notice in unserialize.
https://www.drupal.org/node/2348769/qa
https://www.drupal.org/pift-ci-job/1643959
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3146507-4.patch | 1.18 KB | pfrenssen |
| #9 | 3146507-9-facet-serialization.patch | 534 bytes | DeFr |
Comments
Comment #2
DeFr commentedI can reproduce those fails locally, but ironically enough only in D8.9 with phpunit 7, they're passing just fine with on D9.0 / phpunit 8.
I'm probably going to look into those on Friday if no one post a patch before that.
Comment #3
DeFr commentedSo, I don't have a patch yet, but I'm going to post additional informations I've gathered for now :
Comment #4
pfrenssenThis seems to be similar to #3049250: PHP 7.3 Session Handling Issue, I checked the place in the serialized data where the error is occurring and it is a
Symfony\Component\HttpFoundation\ParameterBagwhich has been incorrectly serialized.Comment #5
pfrenssenThis was not so easy to track down, but it seems indeed to be caused by serializing the Symfony request. Excluding the request from being serialized seems to solve the issue. I'm not sure if the request is ever used after these objects are deserialized again, but the tests are passing and in manual testing all seemed to be fine. It would probably be a good idea though to try to restore the request on wakeup.
Comment #6
DeFr commentedManually queued a test, but yes I think they're going to pass.
Was the url processor hunk really needed ? I think a cleaner fix would be to add those to Drupal\facets\Entity\Facet ; the facet source is getting serialized because that entity has a facet_source_instance cache ; it can be set to NULL on __sleep and will be restored if needed. If the url processor hunk was needed, I guess we'll need to do that to $processors too.
Comment #7
DeFr commented(By the way, thanks a lot for picking this up, I dropped the ball on this, sorry about that !)
Comment #8
pfrenssenI'm not sure if the UrlProcessor change is strictly needed to fix the tests, but I had to drop the request in both to get rid of the errors when using AJAX in the facets form.
Comment #9
DeFr commentedAttaching a patch that should fix the root cause. Fixes the form for me, haven't run the test yet.
Comment #10
pfrenssenGreat, this is the right solution!
Comment #12
borisson_Thanks so much!