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.
Follow up from #1953414: Move logic of field_read_fields() and field_read_instances() to the storage controller.
API Changes
- You have to use entity_load() or entity_load_multiple_by_properties().
Defer getting deleted fields from state only to the disabled modules patch.
Comment | File | Size | Author |
---|---|---|---|
#32 | interdiff.txt | 4.94 KB | yched |
#31 | drop_dead_field_read_x-2018319-31.patch | 34.28 KB | yched |
#28 | interdiff.txt | 4.55 KB | yched |
#28 | drop_dead_field_read_x-2018319-28.patch | 39.01 KB | yched |
#25 | interdiff.txt | 2.84 KB | yched |
Comments
Comment #1
swentel CreditAttribution: swentel commentedTaking this on tonight.
Comment #2
swentel CreditAttribution: swentel commentedLet's see what the bot says.
I haven't removed hook_field_read field as that one goes in #2013939: Remove hook_field_[CRUD]_() in favor of hook_ENTITY_TYPE_[CRUD]() calls
Comment #3
swentel CreditAttribution: swentel commentedNote that I haven't removed the 'included_deleted' option yet, maybe we can defer that to the disabled modules patch ? Thoughts ?
Comment #5
swentel CreditAttribution: swentel commentedNow that was a fun typo.
Need to look at the other failures this evening - unless they suddenly are green as well :)
Comment #6.0
swentel CreditAttribution: swentel commentedUpdated issue summary.
Comment #7
swentel CreditAttribution: swentel commentedActiveTest is still failing for an unknown reason, maybe my mind freshes up in the morning.
Comment #9
swentel CreditAttribution: swentel commentedWe have an actual bug in core re: syncing, this fixes it.
Comment #10
yched CreditAttribution: yched commentedDoesn't this mean that we could restrict with params in _by_properties() instead of loading all ?
The "array" and "with an additional 'bundles' entry" parts are not really true anymore. We could be more drastic here and just say "the field definition" with a type hint on FieldInterface
(same for the next two functions)
Comment #11
swentel CreditAttribution: swentel commentedMakes sense, although the StorageController will load them all then :) Still, this is nicer I guess.
Changed the call in FieldInfo::getInstances() also because I don't think that one was right.
Comment #12
yched CreditAttribution: yched commented#11: 2018319-drop-field-read-x-11.patch queued for re-testing.
Comment #14
yched CreditAttribution: yched commentedTagging
Comment #15
aspilicious CreditAttribution: aspilicious commentedWhile working on this issue I noticed that it takes more than 6 lines to replace a "field_read_field" call...
So this feels like a serious dx regression.
I think it's better to keep these functions for now....
Comment #15.0
aspilicious CreditAttribution: aspilicious commentedUpdated issue summary.
Comment #16
pcambraHere's a reroll to keep this ball rolling after *a lot* of changes around, some of the changes have been made in other parts or the files/calls simply don't exist anymore.
Comment #18
yched CreditAttribution: yched commentedWould be good to get rid of those before beta...
Anyone up for a reroll ?
@aspilicious: does your comment #15 still apply ? do you have specific examples ?
Comment #19
yched CreditAttribution: yched commented"beta target" -> bumping priority accordingly
Comment #20
aspilicious CreditAttribution: aspilicious commentedWe talked about in Prague and it should be less than 6 lines now. We will see if someone gets the patch green without the 'overhead'.
Comment #21
yched CreditAttribution: yched commentedReroll, plus adjusetd the code in ImageStyle::replaceImageStyle() - we should be iterating over EntityDisplays now, not configurable fields.
Conflicts, so no easy interdiff though :-/
Comment #23
yched CreditAttribution: yched commentedNo more field.active
Comment #25
yched CreditAttribution: yched commentedMoar "active/inactive" fixes
+ removes invocation of hook_field_read_*(), that hook is long gone from our api.
Comment #26
areke CreditAttribution: areke commentedOk, this looks good. The patch applies and fixes the issue described. The comments look good too, so RTBC.
Comment #27
amateescu CreditAttribution: amateescu commentedMissed a spot :)
Is this right?
Needs a small rewrap.
And I see that we remove field_read_field[s](), but not field_read_instance[s](), any reason for that?
Comment #28
yched CreditAttribution: yched commented1. Reworded that area a bit.
2. Yeah, it itches me to see those ->getName() calls on code that knows it deals with FieldInstance entities, especially when there's a direct ->entity_type or ->bundle access on the same line :-) So I guess I couldn't resist here.
But right, this change has nothing to do here. Reverted.
3. Fixed.
And indeed, patch was not removong the actual field_read_instance*() functions... Fixed.
Comment #29
amateescu CreditAttribution: amateescu commentedPurrfect, the interdiff looks good so I'm keeping the RTBC status :)
Comment #30
catchActually... could we do the conversion here, then move the actual removal to a separate issue that just removes the @deprecated functions?
We don't have a standard way to deal with @deprecated yet, but for things that should obviously be removed, I might want to try to schedule those patches to land around the same time.
Also that guarantees zero patch conflicts from other patches in the queue that might possibly use these functions still.
Comment #31
yched CreditAttribution: yched commented@catch: sad panda - see #2155697: Remove a couple simple deprecated functions.
July was too late for @deprecated removals, now is too early, at some point it's going to be too late again - slightly disconcerting ;-)
Given the amount of issues still on the table, I'd sure appreciate to call done "done", get those out of my mental plate and avoid the overhead of keeping track of "@deprecated removal" followups while we wait for an appropriate moment to actually remove them hoping we don't miss the moment when it becomes too late again...
But well. Rather get the conversions in while it applies and is green.
Rerolled, keeping the @deprecated functions around.
Not sure what to do with the actual removal then - merge it with #2155697: Remove a couple simple deprecated functions ?
Comment #32
yched CreditAttribution: yched commentedForgot the interdiff.
(looking at it is weird :-p)
Comment #33
catchYes it's a mess with @deprecated, but that's why I'd rather get the conversions in without the mess holding it up.
Comment #34
catchPutting them in the other issue is fine. For functions like this which are not used that massively (compared to node_load() or something), we could probably do a commit just before/after one of the alphas.
Comment #35
catchSee also #2158871: [Policy, no patch] Clearly denote when @deprecated code is slated to be removed.