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.
Per https://github.com/symfony/symfony/issues/3251 the attributes can only be a one dimensional array. That PHP does not throw an error on them is a bug https://github.com/symfony/symfony/issues/7543 (igorw told me to file that as a bug).
The serialization bundle uses a multidimensional array, for now in #1939660-31: Use YAML as the primary means for service registration i have cut it back to a) only support one format per registration b) use format => xml and then we can do more / better here. igorw suggested container parameters to do the tunes of serializer.encoder.xml => XML.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1958484-do-not-test.patch | 13.59 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedComment #2
chx CreditAttribution: chx commentedWhy are these not plugins in the first place?
Comment #3
chx CreditAttribution: chx commentedOK, so I hear they don't want to be plugins.
For easier review, here's the patch for the jsonld,hal and serialization dirs from the YAML service issue.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedTo unblock chx's patch, I'd say we can go ahead with this.
However, it introduces the possibility of a hard-to-debug issue in some cases (described below). We should fix this in this issue once chx's patch is in.
Lets say that JsonLdEncoder supports both jsonld and drupal_jsonld. With the new approach, two services would be registered for the Encoder, encoder.jsonld and encoder.drupal_jsonld. These would both be added to the chain of encoders, for example
JsonLdEncoder - JsonLdEncoder - XmlEncoder - JsonEncoder
If a developer comes along and decides they want to change which Encoder responds to drupal_jsonld requests, they would switch out the service named encoder.drupal_jsonld. This could result in the following chain.
JsonLdEncoder - CustomDrupalJsonLdEncoder - XmlEncoder - JsonEncoder
In this case, since JsonLdEncoder::supportsEncoding returns TRUE for both jsonld and drupal_jsonld, the developer's custom encoder would never be reached. This seems like a developer WTF to me.
Comment #5
damiankloip CreditAttribution: damiankloip commentedThis has already happened, was committed from the issue chx was referring to in#3
Comment #6
chx CreditAttribution: chx commentedWell it happened but I have dumbed it down to make it happen and this issue is whether it needs to be smartened up somehow again :)
Comment #7
damiankloip CreditAttribution: damiankloip commentedOK, fair enough. Let's talk :)
Comment #8
damiankloip CreditAttribution: damiankloip commentedI don't think this needs to be smartened up. The YAML conversion was good I think. chx if you read this, and think it should still be open, please re open. thanks!