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.
Follow-up to #2691337: Merge crm_core_contacts_ui into crm_core_contacts
Problem/Motivation
+++ b/modules/crm_core_contact/crm_core_contact.module
@@ -129,9 +162,8 @@ function crm_core_contact_action_info() {
function crm_core_contact_join_into_household_action_form($context, &$form_state) {
- module_load_include('inc', 'crm_core_contact_ui', 'crm_core_contact_ui.pages');
$household = entity_create('crm_core_contact', array('type' => 'household'));
- $form = crm_core_contact_ui_form(array(), $form_state, $household);
+ $form = crm_core_contact_form(array(), $form_state, $household);
not sure what this is exactly but it should probably go away too as forms in 8.x are classes. again, separate issue, and there are likely more of those unported forms here.
Proposed resolution
Use Form classes.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2694325-9-2.png | 45.38 KB | marthinal |
#9 | 2694325-9-1.png | 72.25 KB | marthinal |
#9 | 2694325-9.patch | 33.81 KB | marthinal |
#8 | 2694325-8.patch | 26.73 KB | marthinal |
#8 | interdiff-2694325-7-8.txt | 21.11 KB | marthinal |
Comments
Comment #2
BerdirLooks like there are a lot of functions and forms related to merging contacts together, all completely unported.
Has dependencies on relationship module, so it seems this is blocked on that. Makes sense to do those together I guess.
Comment #3
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedComment #4
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedFollow-up #2694313: Convert theme functions to templates.
Comment #5
mbovan CreditAttribution: mbovan at MD Systems GmbH commentedPostponed until we fix relationship module.
Comment #6
BerdirI think #2694321: Convert action_info functions to action plugins actually did a large part of this.
However, as commented there, I have my doubts that the merge table actually works. we can possibly use this issue to fix it and improve tests?
Comment #7
marthinal CreditAttribution: marthinal commentedWorking on it this weekend. Looks like the relationship module is not a dependency here.
Adding field for bulk operations.
Needs work. I'll try to continue working on it next week.
I've never used this module so learning how it works.
Comment #8
marthinal CreditAttribution: marthinal commentedWorking a little bit more on it.
Comment #9
marthinal CreditAttribution: marthinal commentedIMHO we don't need to configure the action. So extending ActionBase class. I've created a couple of new routes for the Merge table and for the confirm form.
I'm adding a new "email" field to verify if the merge is correct and... looks ok. Probably needs refactor to improve the table.
I would like to know if this is the correct way. Reviewing the D7 module I see that we use the config form by default to build the table...
Table:
Confirm Form:
Comment #11
grahl