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.
Testbot helper issue for #1875974: Abstract 'component type' specific code out of EntityDisplay.
Comment | File | Size | Author |
---|---|---|---|
#187 | 1848068-187.patch | 26.09 KB | aspilicious |
#184 | 1848068-185.patch | 26.11 KB | swentel |
#183 | 1848068-183.patch | 26.6 KB | swentel |
#181 | 1848068-181.patch | 28.02 KB | swentel |
#179 | 1875974-entity-components-andypost-65.patch | 33.05 KB | andypost |
Comments
Comment #1
yched CreditAttribution: yched commentedComment #2
yched CreditAttribution: yched commentedComment #3
yched CreditAttribution: yched commentedComment #4
yched CreditAttribution: yched commentedComment #6
yched CreditAttribution: yched commented#4: 1830868-32-EntityDisplay_0.patch queued for re-testing.
Comment #8
yched CreditAttribution: yched commentedComment #10
yched CreditAttribution: yched commentedComment #12
yched CreditAttribution: yched commentedStupid me.
Comment #14
yched CreditAttribution: yched commentedComment #16
yched CreditAttribution: yched commentedComment #18
yched CreditAttribution: yched commentedComment #20
yched CreditAttribution: yched commentedComment #22
yched CreditAttribution: yched commentedComment #24
yched CreditAttribution: yched commentedComment #26
yched CreditAttribution: yched commentedComment #28
yched CreditAttribution: yched commentedComment #30
yched CreditAttribution: yched commentedComment #31
yched CreditAttribution: yched commentedmethod renames
Comment #33
yched CreditAttribution: yched commentedComment #34
yched CreditAttribution: yched commentedComment #35
yched CreditAttribution: yched commentedComment #36
yched CreditAttribution: yched commentedComment #38
yched CreditAttribution: yched commented#36: entity_display-testbot-1848068-35.patch queued for re-testing.
Comment #40
yched CreditAttribution: yched commentedComment #42
yched CreditAttribution: yched commentedComment #43
yched CreditAttribution: yched commentedStuck ?
Comment #45
yched CreditAttribution: yched commentedComment #47
yched CreditAttribution: yched commentedComment #49
yched CreditAttribution: yched commentedComment #51
yched CreditAttribution: yched commentedComment #52
yched CreditAttribution: yched commentedComment #54
yched CreditAttribution: yched commentedComment #56
yched CreditAttribution: yched commentedComment #58
yched CreditAttribution: yched commentedComment #60
yched CreditAttribution: yched commentedComment #62
yched CreditAttribution: yched commentedComment #63
yched CreditAttribution: yched commentedComment #65
yched CreditAttribution: yched commentedComment #67
swentel CreditAttribution: swentel commentedKickstarting again, we really really need this for field group, ds and let contrib go nuts! :)
Comment #69
swentel CreditAttribution: swentel commentedShould fix the remaining tests.
Comment #71
swentel CreditAttribution: swentel commentedThis should be green
Comment #73
swentel CreditAttribution: swentel commented#45: entity_display-testbot-1848068-44.patch queued for re-testing.
Comment #74
swentel CreditAttribution: swentel commented#71: display-handlers-testbot-1848068-71.patch queued for re-testing.
Comment #75
Stalski CreditAttribution: Stalski commentedHi, I am looking for the @todo interface in the patch.
Just a question, could it be there is a left over in the patch: there are two
abstract class DisplayComponentHandlerBase
files. I think the "Drupal\entity" namespaced one is not used anymore?Comment #76
yched CreditAttribution: yched commentedEw - right, Drupal\entity\DisplayComponentHandlerBase.php is stale.
For the interface, I was just waiting to settle on the actual methods in the handlers.
Comment #77
swentel CreditAttribution: swentel commentedJust keeping up with HEAD
Comment #79
swentel CreditAttribution: swentel commentedOh right, custom blocks and datetime field have landed too
Comment #80
swentel CreditAttribution: swentel commentedreviving, branch opened in sandbox : entity-display-components-1875974 (I kind of lost the old one apparently)
Had to merge a lot, got notices on standard install, want to give this a roll though.
Comment #82
swentel CreditAttribution: swentel commentedFix discovery
Comment #84
swentel CreditAttribution: swentel commentedMore obvious fixes
Comment #86
swentel CreditAttribution: swentel commentedSeriously
Comment #88
swentel CreditAttribution: swentel commentedComment #89
swentel CreditAttribution: swentel commentedMessy merge with HEAD, let's see what the bot thinks.
Comment #91
effulgentsia CreditAttribution: effulgentsia commented#89: 1848068-89.patch queued for re-testing.
Comment #93
swentel CreditAttribution: swentel commentedre-kickstarting (for the 4th time) on top of the new form modes patch, let's see how this works out.
- also - I switched branches - 1875974-entity-components
Comment #95
swentel CreditAttribution: swentel commentedThis should have a lot more fixes - a little too much code duplication, need to clean that up at some point.
Comment #97
swentel CreditAttribution: swentel commentedUse 'type' again instead of formatter
Comment #99
swentel CreditAttribution: swentel commentedFix more tests, amateescu made the pluginmanager to modern times
Comment #101
amateescu CreditAttribution: amateescu commentedReverted some stuff and fixed the default config files.
Comment #102
amateescu CreditAttribution: amateescu commentedRenamed the 'widget' handler type back to 'field'.
Comment #104
amateescu CreditAttribution: amateescu commentedFixed all getComponent() and setComponent() calls.
Comment #106
swentel CreditAttribution: swentel commentedMore fixes - should fix a lot of notices in the upgrade path
Comment #108
swentel CreditAttribution: swentel commentedEven more fixes
Comment #110
aspilicious CreditAttribution: aspilicious commentedHelping this forward, fixing some tests.
Comment #111
swentel CreditAttribution: swentel commentedaspilicious, can you commit those fixes to the sandbox also ? 1875974-entity-components
Comment #113
aspilicious CreditAttribution: aspilicious commentedI'm a good boy did that *before* posting this patch :D
Comment #114
swentel CreditAttribution: swentel commentedNew patch against latest HEAD
Comment #116
swentel CreditAttribution: swentel commentedMore fixes, getting close to green (again).
Comment #118
swentel CreditAttribution: swentel commentedComment #120
swentel CreditAttribution: swentel commentedFix tons of notices
Comment #121.0
(not verified) CreditAttribution: commentedupdate issue #
Comment #122
amateescu CreditAttribution: amateescu commentedStarted to work on this but I got very confused when I got to DisplayComponentHandlerBase::getRenderer() because we also have a getRenderer() method in EntityDisplayBase. Was the original intention to move it from the config entity class to the new plugin type (component handler)?
Posting just an interdiff for now, nothing committed anywhere :/
Comment #123
yched CreditAttribution: yched commentedI think the intention was:
- external world calls $display-getRenderer($field_name)
- internally the display does $this->handler($field_name)->getRendeter() (and keeps a static cache of the results)
Comment #124
andypostSuppose
$type
should be optional forgetComponent()
, we already store handler_type in display so 123 could workBut for
setComponent()
we need to know the the type of component!Merged current HEAD and made some clean-up, all pushed to 1875974-entity-components-andypost
Comment #126
andypost..drop is moving
Comment #127.0
(not verified) CreditAttribution: commentedUpdated issue summary.
Comment #128
aspilicious CreditAttribution: aspilicious commentedI could install and some of the field stuff worked, lets see
Comment #129
aspilicious CreditAttribution: aspilicious commentedComment #131
aspilicious CreditAttribution: aspilicious commentedComment #132
aspilicious CreditAttribution: aspilicious commentedComment #134
aspilicious CreditAttribution: aspilicious commentedNow without upgrade path tests
Comment #135
aspilicious CreditAttribution: aspilicious commentedComment #137
aspilicious CreditAttribution: aspilicious commentedShould fix most problems, I hope
Comment #139
aspilicious CreditAttribution: aspilicious commentedMore fixes! Less notices!
Comment #141
aspilicious CreditAttribution: aspilicious commentedLets try this one
Comment #142
aspilicious CreditAttribution: aspilicious commentedLess notices on this one.
Comment #144
aspilicious CreditAttribution: aspilicious commentedComment #145
aspilicious CreditAttribution: aspilicious commentedComment #147
aspilicious CreditAttribution: aspilicious commentedComment #148
aspilicious CreditAttribution: aspilicious commentedComment #151
aspilicious CreditAttribution: aspilicious commentedComment #152
aspilicious CreditAttribution: aspilicious commentedFixed some minor issues
Comment #153
aspilicious CreditAttribution: aspilicious commentedAnother reroll
Comment #156
aspilicious CreditAttribution: aspilicious commentedComment #158
andypostNo configuration is prepared so a lot of tests fail
Comment #160
andypostAnother set of changes:
- fix for massageIn() that executed for non-existing field - needs some research
- field handler now injects needed services
- some doc blcok fixes
- added todos
Comment #162
andypostRenamed
massageOut() => onComponentGet()
Decoupled
massageIn() => onComponentSet() and onComponentRemove()
Added doc-blocks
Comment #164
aspilicious CreditAttribution: aspilicious commentedIn the onComponentSet function you need to "change" the options and return the new options.
You're returning a new array overriding the past options.
==> test fails :)
Comment #165
andypostshould fix failed tests, Field handler needs better check for removed field
Comment #166
yched CreditAttribution: yched commentedNo time to look into the interdiffs right now, but +1 on the onXxx() method renames, I was thinking the same while brushing my teeth yesterday night :-)
As for "Handler plugins persisted and shared in the Manager / setContext()" :
Yeah, that was an attempt to avoid creating 2 (or more) handler plugin objects for each EntityDisplay (that is, for each bundle in an entity_view() / entity_view_multiple()). Instead, patch creates one instance of each "handler type" and reuses them for the whole request, injecting the proper context each time with setContext().
I'm not really happy with that either. I fully agree that it is not exactly intuitive, and also probably doesn't play really well with nested entity_view() calls (e.g an entity_ref formatter displaying the referenced entity). Might be a premature optimisation, but hard to tell the exact impact without actual benchmarks though - and entity_view() is definitely a very critical path...
The best route would probably be to remove it for now and switch to a more common pattern of "each EntityDisplay has a PluginBag of Handler plugins". Then benchmark and see if/how we can optimize from there.
Comment #168
andypostMerge after #1988612: Apply formatters and widgets to rendered entity base fields, starting with node.title
Comment #170
andypostLet's test with interface
Comment #171
andypostcheck merge
Comment #173
andypostfix errors
EDIT open again #2210177: Use getSetting() in comment formatter
Comment #175
andypostOne more
Comment #176
andypostUse core's pattern to get field definitions
Comment #179
andypostrender pipeline should change, this just a hack that not commited
Comment #181
swentel CreditAttribution: swentel commentedComment #183
swentel CreditAttribution: swentel commentedComment #184
swentel CreditAttribution: swentel commentedComment #187
aspilicious CreditAttribution: aspilicious commentedLets see...
Comment #194
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedI think further work on this can happen in the main issue now :)