- Issue created by @mattlc
- πΊπΈUnited States apmsooner
Is there another alternative? I don't really want to put a dependency on serialization just to make this work with a contrib module that does not seem to even have that much usage. This seems like something that should be accounted for in the web profiler module IMO. Why would it even be conflicting with normalizers that have nothing to do with it?
- π«π·France mattlc
Actually, the dependency already exists for jsonapi integration in custom_field's code (in all the Normalizer classes).
Normalizers are used when jsonapi module is enabled. jsonapi requires serialization module so this is why the bug is quite "silent".
If you don't want this dependency to be in added to custom_field, one solution could be to move the jsonapi integration (EntityReferenceNormalizer, StringLongNormalizer, UriNormalizer and associated services definitions) to a submodule that depends on serialization core module.
- π«π·France mattlc
Just updated the fix to extract dependency in a submodule.
Also taken care of auto-enable the submodule to keep consistency when jsonapi module is enabled. - πΊπΈUnited States apmsooner
This makes better sense I think. Just remove the serialization dependency from custom_field.info and change the dependency on custom_field_jsonapi.info to drupal/jsonapi since it already has the dependency for serialization.
Technically the keys in custom_field_jsonapi.services.yml should be changed to match the sub-module also.
e.g. custom_field_jsonapi.normalizer.string_long
- π«π·France mattlc
Implemented asked modifications.
Tested on Drupal 11 locally.
Should be tested on both Drupal 11 and Drupal 10.3+ especially with jsonapi enabled prior to update (to test auto-enable of submodule). - πΊπΈUnited States apmsooner
Awesome, thank you! I'll review and merge as soon as I get a chance and should plan to get into next release.