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.
Hello,
From UUID project page:
An API is provided for other modules to enable support for custom entities.
And how should we do that exactly?
I am using Entity API to create custom entities, using model as example.
UUID works fine for custom node content types, it would be nice to have it for custom specialized entities also...
Comment | File | Size | Author |
---|---|---|---|
#6 | uuid-documentation-2236497-6.patch | 543 bytes | RoSk0 |
Comments
Comment #1
mxhHi,
actually this module lacks in terms of a good documentation.
I've developed several entity types by myself and needed UUID integration for them.
I managed to do this with 2 steps:
1. In hook_schema(), where the base table for the entity type is being defined, a column for the UUID is required. If it is an entity type from a third party / contributed module, you may need to run a hook_schema_alter() or update hook to add this column to the base table of the entity type. Example for hook_schema():
2. Mark your entity type in hook_entity_info() that it shall have UUIDs. If it's an entity type from a third party / contributed module, you will need to add the required info by implementing hook_entity_info_alter(). Example for hook_entity_info():
Comment #2
Talkless CreditAttribution: Talkless commentedThanks max-haupt, although I do not need this any more, it will help others searching for solution!
Comment #3
Talkless CreditAttribution: Talkless commentedComment #4
RoSk0Don't agree that this is fixed.
We need to put this documentation in some better place like Drupal.org documentation or DEVELOPERS.txt file in module. I'm ready to do either, but need to know what is preferred way from maintainers, to avoid extra work.
Comment #5
mxhAgree with it that it's not yet fixed, because documentation is needed. But it's not really a repercussion ;)
I'm used to read official online documentations on drupal.org, since these ones are more detailed and structured than plain text files. Furthermore it may be read and extended / corrected easily by any other community member, which is another plus for the online doc.
Comment #6
RoSk0Created documentation page - https://www.drupal.org/node/2387671, and a patch to put the link to this page in the README.txt.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedRTBC.
Comment #9
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedThanks for the patch. I've committed it.