The current architecture for modifications is a bit weird ... what about introducing a consumer plugin.

What can a consumer plugin do

  1. Register base fields for storage reasons ...
  2. Provide a way to show information on the consumer list
  3. Maybe more?

Some thoughts?

Comments

dawehner created an issue. See original summary.

e0ipso’s picture

Sounds good!

My only concern would be that we'd be boxing ourselves in that list of features. The current pattern implements the standard hooks for altering fields, which is what I'd look up first when debugging the module.

Do you want to take a quick stab at what that plugin would look like?

dawehner’s picture

Assigned: Unassigned » dawehner

My only concern would be that we'd be boxing ourselves in that list of features.

You are totally right, though to be honest, we could still document that you can do whatever the hack you need to do, if you want to, but here is a nice and easy way to do the common things ... does that make sense?

I'm gonna give it a quick try.

dawehner’s picture

Assigned: dawehner » Unassigned
Status: Active » Needs review
StatusFileSize
new7.84 KB
new2.55 KB

  • e0ipso committed 2fc1351 on 8.x-1.x authored by dawehner
    feat(Fields): Alternative architecture (#2906900 by dawehner, e0ipso)
    
e0ipso’s picture

StatusFileSize
new2.02 KB
new489 bytes

Merged with small changes.

e0ipso’s picture

Sorry, the above files are interdiffs, not patches.

e0ipso’s picture

Also merged the companion patch to the image styles. See http://cgit.drupalcode.org/consumer_image_styles/commit/?id=ab1d366

e0ipso’s picture

Status: Needs review » Fixed
dawehner’s picture

Nice!

  • e0ipso committed ef5644c on 8.x-1.x
    Revert "feat(Fields): Alternative architecture (#2906900 by dawehner,...
dawehner’s picture

Status: Fixed » Needs work
e0ipso’s picture

Version: » 8.x-1.x-dev

Maybe when we get back on this, we can have a nice UI autogenerated. I did this in the past for the seed code on the Social API initiative.

See for instance the example here: https://www.drupal.org/docs/8/contrib/social-api/social-widgets

dawehner’s picture

I'm been talking with @bojanz about what they call entity traits. There you can configure "traits" per bundles, which provide additional fields automatically. Behind the doors they are using configurable fields instead of base fields, given all the complexity potentially involved with altering the existing database table.

e0ipso’s picture

@dawehner I'm not sure I have enough context for that. Is this something you'd be interested to take on, or provide more context for others?

e0ipso’s picture

Status: Needs work » Closed (outdated)

We've been running with the current architecture for a while without significant issues.