Standardize adding a new bundle to an entity type

Created on 14 June 2011, over 13 years ago
Updated 14 February 2024, 11 months ago

Coming over from 📌 Entity providing modules must call field_attach_delete_bundle() in hook_uninstall() Fixed .

webchick asked in irc whether we could make the test generic. That would be a good idea, but I don't think it's doable at the moment.

The test would look something like this:

Enable all modules available.

Create at least one bundle for each entity type.

Add a field instance to each bundle.

Disable all the modules.

Uninstall all the modules.

Re-enable all the modules.

Add a same-named bundle to all entity types again.

Recreate the field(s).

Create field instances to all the entity types again.

This is all doable except for the "Create at least one bundle for each entity type." which is completely non standard at the moment.

node_type_save() (which magically creates bundles for comments too, who's idea was that?!?)
taxonomy_vocabulary_save()
etc. etc.

It would be good to standardize this stuff, bundles are a bit messy at the moment in general, so opening a new task.

📌 Task
Status

Closed: outdated

Version

9.5

Component
Entity 

Last updated about 17 hours ago

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom catch

    Bundle creation is still per-entity type and there's no plans to change it, if there were, we should start again.

Production build 0.71.5 2024