Skip to content
Snippets Groups Projects
Commit 8c813b1e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2812625 by quietone: contact_category should dedupe contact_form not user_role

parent 2b74c933
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -12,8 +12,8 @@ process: ...@@ -12,8 +12,8 @@ process:
source: category source: category
- -
plugin: dedupe_entity plugin: dedupe_entity
entity_type: user_role entity_type: contact_form
field: cid field: id
length: 32 length: 32
label: category label: category
recipients: recipients recipients: recipients
......
...@@ -47,6 +47,29 @@ public function testContactCategory() { ...@@ -47,6 +47,29 @@ public function testContactCategory() {
$this->assertIdentical(array('fortyninechars@example.com'), $contact_form->getRecipients()); $this->assertIdentical(array('fortyninechars@example.com'), $contact_form->getRecipients());
$this->assertIdentical('', $contact_form->getReply()); $this->assertIdentical('', $contact_form->getReply());
$this->assertIdentical(2, $contact_form->getWeight()); $this->assertIdentical(2, $contact_form->getWeight());
// Test there are no duplicated roles.
$contact_forms = [
'website_feedback1',
'some_other_category1',
'a_category_much_longer_than_thir1',
];
$this->assertEmpty(ContactForm::loadMultiple($contact_forms));
/*
* Remove the map row for the Website feedback contact form so that it
* can be migrated again.
*/
$id_map = $this->getMigration('contact_category')->getIdMap();
$id_map->delete(['cid' => '1']);
$this->executeMigration('contact_category');
// Test there is a duplicate Website feedback form.
$contact_form = ContactForm::load('website_feedback1');
$this->assertSame('Website feedback', $contact_form->label());
$this->assertSame(array('admin@example.com'), $contact_form->getRecipients());
$this->assertSame('', $contact_form->getReply());
$this->assertSame(0, $contact_form->getWeight());
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment