Problem/Motivation
#2751325: All serialized values are strings, should be integers/booleans when appropriate was committed with an opt-in backwards compatibility layer to retain the current behaviour of outputting everything as a string.
However there are two reasons we might not want to maintain that bc layer:
1. In general, casting issues are due to having to cast '1' to 1 (For comparisons and similar), often in tests. It's much less likely that a client would get an integer and choke on it because it had previously got a string. We also expect it to be a quick update for clients if they do run into a problem.
2. If we need to change output again, we'll have two bc layers, instead of two output variants, this will give us four:
1. No bc layer
2. BC layer 1 only
3. BC layer 2 only
4. BC layer 1 + BC layer 2
That problem will get worse if there was a third issue too.
Proposed resolution
Consider a deprecation notice if the bc-layer is enabled (add it to 8.3.x or 8.4.x) and then remove the bc layer in 8.4.x or 8.5.x. This gives clients a 6-12 month window to update if they need to, without maintaining a potentially redundant and/or progressively more complex bc layer for years.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#15 | 2856594-15.patch | 3.73 KB | Wim Leers |
#13 | 2856594-13.patch | 1.46 KB | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Wim LeersComment #7
Wim LeersComment #8
catchCan we just update this to deprecate the bc layer for Drupal 9? We barely have three Drupal 8 releases in which to do a staggered deprecation now.
Comment #9
Wim LeersYou mean adding a deprecation notice during 8.x and removing the BC layer in 9.0?
Comment #10
catchYep.
Comment #11
Wim LeersWFM! The key question is, where would we add that deprecation notice?
This is a piece of configuration that affects executed code. If we throw the deprecation notice upon every string normalization you're … going to see a lot of these in your logs. Perhaps that's okay?
Comment #12
catchI don't think that's different from running a contrib module using something deprecated so should be OK.
Comment #13
Wim LeersComment #15
Wim LeersComment #24
catchThis has been done elsewhere as far as I can tell.