-
-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a custom field handler #399
Comments
I think we need a proper plugin system for field handlers, not the half-baked home-baked plugins we currently use. My idea is use D8's core-plugins component as a composer dependency and build Field and Entity plugin systems using that. Would be sweet. |
Has there been any more work done on implementing a plugin system to extend the field handlers allowed? We are looking at supporting the To get the handler class loaded in a composer managed codebase, with the current implementation of I haven't tried this yet, but it seems like it should work. |
See jhedstrom/DrupalDriver#157 I figure we're 80% of the way there. Reviews and help very much appreciated. It works fine already for D8, and you could use it as a patch, but not in a way that would give you perfect stable forward compatibility. If your needs are complex (multiple inter-related entities, interventions at different points in entity lifecycle), it might be worth it. If they are simple (e.g. just one field) and you don't want to have to make adjustments down the road, then it's not for you right now. I think I've seen someone make a custom field handler work by slipping the class into their FeatureContext file. |
From what I can tell in \Drupal\Driver\Cores\AbstractCore::getFieldHandler(), the only way to add a custom field handler is to put it in the \Drupal\Driver\Fields{core} namespace.
We are using a Composer-based build process, so when we require custom field handlers, I'm just adding patches to drupalextension to place a new field handler into the proper directory.
Is there another way to do this currently? If not, should there be? It seems like something a custom module that defines a custom field should be able to add.
The text was updated successfully, but these errors were encountered: