Closed (fixed)
Project:
Drupal core
Version:
9.0.x-dev
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2020 at 07:17 UTC
Updated:
12 Mar 2020 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
hardik_patel_12 commentedKindly review a patch.
Comment #3
hardik_patel_12 commentedComment #4
longwaveTwo straightforward deprecations, no further deprecated code in this component.
Comment #5
alexpottI think we need to re-focus this issue to cause a proper deprecation for TranslationWrapper - since, fun fact via @Berdir, it's still present in our database dumps - see what happens if you do
gunzip -c core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz | grep TranslationWrapperSo let's leave the rest of the deprecations here to #3104307: Remove BC layers in various Drupal\Core components and instead add an @trigger_error and derpecate this class for Drupal 10. And work out how to have an upgrade path for things like the our db dumps.
Comment #6
andypostIt was deprecated in CR https://www.drupal.org/node/2571255 before 8.0, would be great to understand how dumps were populated and why they having it - maybe re-build dump
Comment #7
berdirWe know why it does, it is part of entity type definitions for example, and no, we don't need to rebuild the dumps because real sites have it too, so our dumps having it is a good thing.
I'm not sure how to get rid of this to be honest. For installed entity type definitions, we can go through them and replace those classes with the undeprecated version. But who knows who else that stuff might be stored.
Comment #8
andypostAt least we need to deprecated it properly (guess 10.0.0 is ok here, then it needs 8.8 backport?) and add test
Comment #9
andypostFix copy/paste test method
Comment #10
andypostProbably test should be extended to prove the class works
Comment #11
andypostThe better one
Comment #12
alexpottthis isn't a plugin - we can do the deprecation at the top of the class.
Comment #13
andypostThank you, updated IS and fixed #12
Comment #15
andypostSo the last patch is wrong because this update dump contains a lot of mentions in entity type definitions and
Comment #16
alexpott@andypost the last patch is correct. It shows that in order to deprecate TranslationWrapper we have to somehow fix the entries in the state tables as we're still using it.
Comment #17
andypost@alexpott as I see in related dumps were created from 8-rc1 profile very probably on cache clear definitions are not updated
Probably it needs to upgrade dumps and write some update hook to check that definitions using to store TranslatableMarkup
Comment #18
andypostThis update works but needs tests and still fail of the test
Entity backups also could be fixed, stub as TODO
Comment #20
berdirIMHO we should split up the deprecation change and getting rid of usages. Getting rid of the D9 deprecation is kinda beta-blocking, but once we change it to D10, it no longer is. So I'd propose to go with a minimal patch here.
That could be #11, or it could just be the existing description.
Comment #21
alexpott@Berdir #11 is not a good because adding a deprecation message to the constructor. I think what we should do here is to change the message to deprecate in D10 and file a follow-up to do #20.
Comment #22
berdirI'm fine with either option, adding the message to the constructor or just the minimal part of changing the message. To me, adding it at least to the constructor allows us to warn on new uses of the class, where it's actually being instantiated. There aren't many of them but a few are still there: http://grep.xnddx.ru/search?text=new%20TranslationWrapper. And then we can move it outside when we eventually got rid of the serialized ones too.
And unless we do that by messing with the serialized strings, we'll need to load those objects so we can get rid of them, thereby triggering the deprecation. But then again, that's expected from update functions, that they sometimes need to trigger deprecated code. But it also means we'll need to those update functions into D9.x early enough to be able to remove them again if we want to have a chance for removing the class in D10.
Comment #23
andypostI wanted to file follow-up to decide about clean-up, I stuck on finding more places where serialised classes could live in database
+1 to option where it will be less noisy because clean-up of serialisation could be tricky if we allow replacement for igbinary for example.
Moreover the trick with get/set maybe be not allowed for other places (outside of state)
Comment #24
alexpott@Berdir great point about the constructor deprecation and contrib. So yeah let's do #11 but we need a follow up to do #18 and move the deprecation to the class's MAIN section.
Comment #25
andypostFiled follow-up for #18 #3115726: Clean-up usage of serialized TranslationWrapper from database
I did not get it
Comment #26
andypostFor 11
Comment #27
alexpott#11 looks great. But it should be the last patch on the issue.
Comment #28
andypostre-upload 11
Comment #29
alexpott@andypost thanks this looks great. I think we should also consider this for 8.9.x too.
Comment #30
catchOnly concern with this issue is it seems like we can't actually remove it in 10.0.x for similar reasons to not being able to do so here - i.e. it's stored in the database, so until we resolve that it's not entirely deprecated.
Maybe just a follow-up to discuss that issue a bit though?
Comment #31
andypost@catch I filled follow up for that in #25
Comment #33
catchOh good point. In that case.
Committed d185342 and pushed to 9.0.x. Thanks!