Problem/Motivation
Started having test failures like this:
efault value for disabled_container_datetime: expected array ( 'date' => '1978-11-01 10:30:00', 'timezone_type' => 3, 'timezone' => 'Europe/Berlin', ), returned array ( 'date' => '1978-11-01 10:30:00.000000', 'timezone_type' => 3, 'timezone' => 'Europe/Berlin', ).
Tracked it down to this change in PHP: https://github.com/php/php-src/commit/fdb2709dd27c5987c2d2c8aaf0cdbebf9f...
We currently hardcode the expected value.
Proposed resolution
Use json_decode(json_encode()) so that the expected matches whatever a given PHP version will output.
Not great, but what we are doing is a bit... special so I think that's ok. Could think of more problematic issues with that change, though.
Remaining tasks
We could consider checking with PHP to undo this or something, but versions with it are already out, so I think it's not likely that will happen and the broken PHP versions are out there.
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#8 | 2316153-fix-typo-8.patch | 1.16 KB | Berdir |
#1 | json_encode-2316153-1.patch | 1.18 KB | Berdir |
Comments
Comment #1
BerdirComment #2
tim.plunkettComment #3
chx CreditAttribution: chx commentedLast time I tried to talk to the PHP team about BC I was told new warnings are not breaking backwards compatibility. Good luck convincing them that this one does.
Comment #4
BerdirJust confirmed this with PHP master/NG/5.7, that I prepared for performance*/compatibility tests. FormTest HEAD fails, passes with the patch.
* First result on that was this test. 5.4: 1m37s. 5.7: 57s. Promising start.
Comment #5
webchickThat's a very silly workaround for us to have to do, but I don't have any other bright ideas. :\
We're very near an alpha, but this is holding up provisioning of new testbots, and there are multiple sprints coming up this week. So...
Committed and pushed to 8.x. Thanks!
Comment #7
catchmicrosends.
Comment #8
BerdirUps.
Comment #9
chx CreditAttribution: chx commentedhap shittens, it's OK.
Comment #10
catchCommitted/pushed to 8.x, thanks!
Comment #13
vijaycs85Let's port this to 8.1.x-dev as well as it breaks there (ref: https://www.drupal.org/node/2384853#comment-9391473)
Comment #14
BerdirAs discussed on IRC.
Comment #15
vijaycs85Thanks @Berdir. @alexpott said that 8.1.x is not open for development and we got the branch just to postpone issues on it. So ignore #13