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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mbovan created an issue. See original summary.

Berdir’s picture

Title: Use form classes instead of form functions » Port contact merge functionality

Looks 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.

mbovan’s picture

Assigned: mbovan » Unassigned
slashrsm’s picture

mbovan’s picture

Status: Active » Postponed

Postponed until we fix relationship module.

Berdir’s picture

Status: Postponed » Active

I 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?

marthinal’s picture

Assigned: Unassigned » marthinal
FileSize
168.65 KB
8.11 KB

Working 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.

marthinal’s picture

FileSize
92.05 KB
21.11 KB
26.73 KB

Working a little bit more on it.

marthinal’s picture

Status: Active » Needs review
FileSize
33.81 KB
72.25 KB
45.38 KB

IMHO 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:

Status: Needs review » Needs work

The last submitted patch, 9: 2694325-9.patch, failed testing.

grahl’s picture

Version: 8.x-1.x-dev » 8.x-3.x-dev
Assigned: marthinal » Unassigned