hook_entity_info revision_id is not required(like commerce_product)
list($entity_id, $revision_id, $bundle) = entity_extract_ids($entity_type, $entity);
if(!isset($revision_id)) $revision_id = $entity_id; // use entity_id as revision_id
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1188932-revision_id-null.patch | 1.21 KB | dawehner |
Comments
Comment #1
dave reidIn which case it should allow the module to store NULL in the database and work as designed. Is this not the case?
Comment #2
hibersh commentedentity_extract_ids('commerce_product', $entity) return a NULL revision id, gotta error insert a null value in to table.
"commerce_product" is a entity type without revision.
Comment #3
dawehnerYou aren't allowed to use NULL in any kind of db_select/db_delete but you can use 0.
I think it's correct that entity_extract_ids return NULL for revision_id here.
@hibers
Needs review means that there is a patch.
With this patch it's possible to save terms on users.
Comment #4
dave reidd'oh! I double checked and Field API stores revision_id = entity_id in this case, so I slightly adjusted #3 to do that.
http://drupalcode.org/project/taxonomy_entity_index.git/commit/e3ff407