Problem/Motivation
The annotations have quite a bit of cruft. Lets update them and benefit from newer features
Proposed resolution
Looking at Contact, check others too for similar problems:
* fieldable is gone, remove
* not sure if label_callback() still works, we should probably just override the label() method
* vid is a bad revision ID field name, copied from node. possibly rename? (to revision_id)
* user entity key doesn't exist
* link template should be edit-form not edit_form
* call the parent \Drupal\Core\Entity\ContentEntityBase::baseFieldDefinitions() to get the default base field definitions (requires 8.1, but that's OK)
* getChangedTime() is wrong, should return a value, remove it in favor of the trait that is already used.
* \Drupal\crm_core_contact\Entity\ContactType::preDelete() still calls watchdog()
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#9 | clean_up_entity_type-2694357-9-interdiff.txt | 800 bytes | mbovan |
#9 | clean_up_entity_type-2694357-9.patch | 16.04 KB | mbovan |
#6 | clean_up_entity_type-2694357-6-interdiff.txt | 721 bytes | mbovan |
#6 | clean_up_entity_type-2694357-6.patch | 15.26 KB | mbovan |
#4 | clean_up_entity_type-2694357-4.patch | 14.56 KB | mbovan |
Comments
Comment #2
BerdirOne more thing, extend ContactTypeDeleteForm from the entity delete confirm form, remove everything that we no longer need. possibly everything...
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedComment #4
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedAddressed the issue summary points and did some additional cleaning.
Do we need to update the labels (Contact ID, Contact Type...)?
Is this useful anymore?
Comment #5
BerdirI think the hook is still useful. The standard labels (ID instead of Contact ID) are fine with me.
This is handled automatically now? Would be nice to have test coverage, if only to see how it works now.
Comment #6
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedI think we already have tests for this in
ContactUiTest::testContactTypeOperations()
, added some more.Comment #7
thenchev CreditAttribution: thenchev at MD Systems GmbH commentedAre we doing changes in legacy folder? Just wondering.
Also i see 'vid' in crm_core_contact_ui_revert_form.
Comment #8
BerdirFor code that we eventually want to port like this I think it makes sense, yes.
Comment #9
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedUpdated the variable names in
crm_core_contact_ui_revert_form()
as well.Comment #10
thenchev CreditAttribution: thenchev at MD Systems GmbH commentedDidn't notice anything else.
Comment #12
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedCommitted. Thanks.
Comment #14
mbovan CreditAttribution: mbovan at MD Systems GmbH commented