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
Serializer's interface was recently changed
All serializer interfaces (Serializer, Normalizer, Encoder) have been extended with an optional ``$context`` array. This was necessary to allow for more complex use-cases that require context information during the (de)normalization and en-/decoding steps.
As mentioned in #1880424: Handle entity references on import and code comments, the $context parameter could be useful for us.
Proposed resolution
Update Serializer using composer and change all Normalizers and Encoders to support the new interface.
Comment | File | Size | Author |
---|---|---|---|
#21 | 1894508-21.patch | 61.39 KB | scor |
#20 | 1894508-20.patch | 60.38 KB | damiankloip |
#12 | 1894508-11.patch | 52.88 KB | damiankloip |
#11 | 1894508-11-update-serializer.patch | 52.09 KB | linclark |
#5 | 1894508-03-update-serializer.patch | 55.04 KB | linclark |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThis updates the Serializer code and our Normalizers. We don't have Encoders we need to worry about yet, but will if #1880424: Handle entity references on import gets in.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #4
Crell CreditAttribution: Crell commentedRelated: #1893470: Update dependencies, add PSR\Log
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedForgot about the test encoder.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commented#5: 1894508-03-update-serializer.patch queued for re-testing.
Comment #8
Crell CreditAttribution: Crell commentedTalked this through in IRC. We can pin the commit for the serializer library in #1894002: Update vendor libraries and pin them to specific versions in composer.json, which is paused until Symfony 2.2-beta2 is out later this week. This takes care of the API change, so let's get it through now to keep things simple.
Comment #9
webchickThis doesn't apply for me.
Comment #10
Crell CreditAttribution: Crell commented#5: 1894508-03-update-serializer.patch queued for re-testing.
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedMerged in the changes from a routing update and updated the XMLEncoder which was committed today.
Comment #12
damiankloip CreditAttribution: damiankloip commentedRerolled and included what was committed earlier in #1854874: Add serializer support for XML.
Comment #13
damiankloip CreditAttribution: damiankloip commentedDoh! sorry, x-post on the reroll there. I guess we can compare...
Comment #14
damiankloip CreditAttribution: damiankloip commentedLin, shall we go with your patch in #11 due to the routing changes you made?
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedNo, I don't think there's a functional difference there. Your patch follows our code style better, so lets go with #12.
Comment #16
Anonymous (not verified) CreditAttribution: Anonymous commentedSince Crell already RTBCed this and it only needed a reroll, I'm going to re-RTBC it.
Patch in #12 should be used.
Comment #17
Crell CreditAttribution: Crell commentedRe-confirming my RTBC.
Comment #18
webchickGetting this in while it's hot!
Committed and pushed to 8.x. Thanks!
Comment #19
webchickSorry, I lied. #1894508: Update symfony/serializer was 700K + a critical, so it won the great battle of conflicts. I reverted this commit, so this will need a re-roll now.
Comment #20
damiankloip CreditAttribution: damiankloip commentedStop playing with our emotions like that! :)
Rerolled.
Comment #21
scor CreditAttribution: scor commented#20 looks good. this patch pins the serializer dependency to beta2
Comment #22
Crell CreditAttribution: Crell commentedBack to RTBC, since the combined pinning patch is still breaking.
Comment #23
webchickCommittin' this while the committin' is good. :D
Committed and pushed to 8.x!
Comment #24
tim.plunkettI'm reasonably sure this is what broke HEAD. It changed the autoloader which would explain the fails.
Not in front of a computer to test though.
Comment #25
ParisLiakos CreditAttribution: ParisLiakos commentedcore is green again