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
in #1730874: Add support for loading multiple revisions at once we deprecated doLoadRevisionFieldItems(), but left its use in doLoadMultipleRevisionsFieldItems(). In #3069043: Trigger an error on direct access of ContentEntityStorageBase::doLoadMultipleRevisionFieldItems() and mark it to be set abstract in Drupal 9 We deprecated calling ContentEntityStorageBase::doLoadMultipleRevisionsFieldItems directly and triggered an error, declaring the method would be abstract in Drupal 9
Proposed resolution
Remove the logic and make the method abstract
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#36 | 3069696-36.patch | 89.02 KB | dhirendra.mishra |
#36 | interdiff_32-36.txt | 354 bytes | dhirendra.mishra |
Comments
Comment #3
BerdirExpanding the scope here to the whole Entity component.
Comment #4
BerdirComment #5
BerdirSome fixes.
Comment #7
BerdirFixed a pretty stupid mistake and removing some legacy tests. Not quite sure what to make of SqlContentEntityStorageSchemaConverter.php, there are some tests failing that use it in entity_test, I guess that will be removed in the update path removal issue.
Should mostly be just update path test failing now. So this is as far as we'll get until those are gone.
Comment #8
BerdirComment #9
BerdirReroll and combined with the update removal patch to see if there's something left after it.
Actual patch is quite a bit smaller as some things were already removed.
Comment #10
BerdirComment #11
hchonovWe introduced the property just because to allow extending the revision metadata keys when the BC layer is used, but now that it is being removed I think we should remove the property as well and instead add the default revision metadata keys in
ContentEntityType::__construct()
like we do for the entity keys inEntityType::__construct()
.Comment #12
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedNote that the BC layer for revision metadata keys is being removed in #3099789: Remove the BC layer for revision metadata keys, so those parts should be taken out from this patch at some point.
Comment #13
BerdirYeah, since that is non-trivial, I think I'll just wait until that is committed and then reroll this. We have quite a bit of a dependency chain right now ;)
Comment #14
BerdirThe update path is gone, so here's a reroll with some additional removals.
Still postponed on the metadata issue, will reroll and resolve the conflicts with that when it is in.
Comment #15
Wim LeersThis is postponed on #3099789: Remove the BC layer for revision metadata keys, and which other issue?
Comment #16
BerdirThe one that #3099789: Remove the BC layer for revision metadata keys was blocked on but looks like the new plan is to do them in parallel, one for 8.x only and that for 9.x.
Comment #17
BerdirRebased.
Comment #18
BerdirComment #19
longwaveThis was never deprecated with trigger_error() and seems used quite heavily in contrib: http://grep.xnddx.ru/search?text=isSubclassOf&filename=
As it doesn't really hurt to leave it we could bump removal of this to 10.x?
Comment #20
Gábor HojtsyWoot, this has 23 @deprecated which is 59% of all the remaining ones (where some of the remaining ones are for testing deprecation tooling itself). So this would singlehandedly remove almost everything left deprecated in Drupal 9.
Comment #21
alexpottI agree with @longwave - let's properly deprecate isSubclassOf() and move it to D10. We can do that in another issue though - so let's not make a change to it here.
5 pages on http://grep.xnddx.ru/search?text=isSubclassOf&filename= and maintaining the method with no logic is not that bad.
Comment #22
longwaveOpened #3115608: Properly deprecate EntityType::isSubclassOf()
Comment #23
longwaveAlthough @init90 informed me that the issue already exists: #3113020: Properly deprecate \Drupal\Core\Entity\EntityTypeInterface::isSubclassOf()
Comment #24
catchBack to needs work for removing the isSubclassOf() removal.
Comment #25
BerdirAdded that back.
Comment #26
andypostFixed CS and useless var
label_key is unused now
is bit different from previous
Comment #27
longwaveStill a number of references to
label_callback
which is removed here. I haven't looked into it but why doesn't EntityTestLabelCallback fail now, given its name?Comment #28
longwaveIf the 'handler' key is removed from SelectionPluginBase it feels like this code in SelectionPluginManager::getInstance() can be refactored away now? We shouldn't need
$options['handler']
at all any more?Comment #29
BerdirThanks for the review.
#27: entity_test_label_callback still had a label callback and was used in one other test but that just wants a long entity type id that's long, so I gave it an even longer one. Deleted the entity type as it was just in a test module.
Updated the docblock for the rest test class and removed the bogus definition there (label callbacks can't be methods, that was never called)
#28: This is still used IMHO, see for example \Drupal\Core\Entity\EntityAutocompleteMatcher::getMatches(), we no longer have it in the settings but it's still passed in there to getInstance() as that's the only argument that we have.
Comment #30
Wim Leers🔥This helps a lot with #2491981: There are too many ways to generate URLs and links 🥳
Comment #31
longwaveI retract #28, it is only the default that has been removed and we still need 'handler' otherwise.
There is a
getLabelFromPlugin()
method that can also be removed.Comment #32
andypostFix #31
Comment #33
longwaveNothing left to do here, let's get this done!
Comment #34
alexpottSome random thoughts:
Drupal\Core\Entity\Entity
usage - but that was deprecated properly and any modules that we typehinting on it were already broken.'type' => 'hidden'
is going to painful - http://grep.xnddx.ru/search?text=%27type%27%20%3D%3E%20%27hidden%27&file... - as a programmatic deprecation tools like PHPStan can't detect this.Not sure what to do about the last one. I think that that is going to catch some people out but at least once they've fixed their code it will still work on D8.
One thing we definitely have to do is:
We're missing the removal of \Drupal\views_ui\ViewUI::urlInfo()
Comment #35
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedComment #36
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedHere is the removal of Drupal\views_ui\ViewUI::urlInfo().
Comment #37
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedComment #39
BerdirRandom fail? Retest requested and setting back to RTBC.
> There's going to be plenty of modules that have to clean up Drupal\Core\Entity\Entity usage - but that was deprecated properly and any modules that we typehinting on it were already broken.
Sure about that? While I wasn't a fan of the rename, I wouldn't expect a lot of direct usages of this. Pretty much everything is either a config or a content entity or uses EntityInterface as type hint/reference. http://grep.xnddx.ru/search?text=use%20Drupal%5CCore%5CEntity%5CEntity%3B does show 5-ish pages of results, which I guess is more than I expected but managable, considering how widely the entity API is used.
type hidden is a bit unfortunate, but looks like most usages are either hidden base field definitions (where the whole thing is bogus, if you want it hidden, just don't do anything, you can still make it optionally configurable) as well as a considerable amount of old feature exports, which aren't going to hurt. The most unfortunate thing is IMHO actually that nothing really came from it, field_layout is about to be removed from core :)
Comment #40
alexpottCommitted b57afe5 and pushed to 9.0.x. Thanks!
Comment #42
effulgentsia CreditAttribution: effulgentsia at Acquia commentedWe need a follow up issue for:
ConfigEntityStorage
.|null
from the @param declaration. Both here and in subclasses.Comment #43
phenaproximaFollow-up has been opened: #3118998: Remove null default for $memory_cache in entity storage handler constructors. Restoring the old status.
Comment #44
xjmThis is a pretty massive cleanup; are there any riskier/internally disruptive changes that might merit a release notes?
Comment #45
BerdirThe trickiest part is possibly #3099789: Remove the BC layer for revision metadata keys, if you'd still rely on the BC layer for your entity type and then update to D9 then... weird things might happen. If you actually use the trait you should get an exception, but it's likely that you don't.
There are some config related removals, those are always tricky, and things might show up incorrect when importing default config in D9, and the label callback would also more or less silently stop working for an entity type, but I think that wasn't too widely used.