Problem/Motivation
Much configuration relates to users and should be packaged together.
Proposed resolution
Iterate through user bundles and create a package for each.
$bundles = entity_get_bundles('user');
foreach ($bundles as $machine_name => $bundle) {
// Generate a feature for each, using $machine_name and $bundle['label'] as the name.
}
Possibly this should instead be more general and not specific to the user entity type. Offer a list of entity types that support bundles, and then generate a feature per bundle for each. This might, in fact, just be an enhancement of the existing base type
plugin to offer as options all bundle-able entity types.
Remaining tasks
User interface changes
API changes
Comments
Comment #1
nedjoOn second thought, this seems like a variation of the existing base-type plugin, in that, in its default configuration, that plugin currently creates a package for each node bundle (content type). We could extend that to include user bundles.
Comment #2
nedjoComment #3
nedjoComment #4
nedjoHere is a patch implementing this.
It introduces a second set of checkboxes to the 'base-type' assignment plugin configuration form, for selecting entity types. Screenshot:
The patch also includes #2579763: Only list bundle-providing configuration types as options for 'base-type' assignment plugin. We limit the configuration types shown to those that provide bundles to other entity types. Then, when listing entity types, we show only those that are content bundle types and do not have their bundles provided by other entity types. This way, we don't end up with duplicated options. (For example, since the node_type (Content type) configuration entity type provides bundles (for node), it appears in the first list but node doesn't appear in the second.
By setting 'user' as a default content entity type, a new 'user' package is generated. While no configuration is added to it in this assignment plugin, it will get configuration assigned if other plugins like namespace are enabled.
Screenshot of user package with default settings and standard install profile:
A fair bit of this patch is just what's needed to inject the entity.manager service.
Note that this patch will break backward compatibility for plugin configuration, because it changes the format from
to
Comment #5
nedjoComment #6
nedjoComment #8
nedjoApplied. As noted, this will break backwards compatibility.
Comment #9
nedjoTips for fixing your site after updating.
We're in alpha. Should there nonetheless be an update here? If you think so, please reopen this issue.
Comment #10
nedjoComment #12
nedjo