From 28a74dffcaebb6b49b772f01afba5aebf56f8398 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 1 May 2020 14:57:48 +0200 Subject: [PATCH 01/10] rename the entity base table from backerymails_sended_mail to backerymails_sent_mails --- backerymails.install | 22 ++++ backerymails.post_update.php | 39 +++++++ config/install/views.view.backerymails.yml | 20 ++-- src/Entity/BackerymailsEntity.php | 2 +- ...drupal-8.backerymails-entity-installed.php | Bin 0 -> 20384 bytes ...rupal-8.backerymails-entity-typos-8001.php | Bin 0 -> 20604 bytes .../drupal-8.backerymails-installed.php | 44 ++++++++ ...ameAndMigrateEntityTableUpdate8001Test.php | 97 ++++++++++++++++++ ...pEntityTableUpdate8001WhenExistingTest.php | 94 +++++++++++++++++ 9 files changed, 307 insertions(+), 11 deletions(-) create mode 100644 backerymails.post_update.php create mode 100644 tests/fixtures/update/drupal-8.backerymails-entity-installed.php create mode 100644 tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php create mode 100644 tests/fixtures/update/drupal-8.backerymails-installed.php create mode 100644 tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php create mode 100644 tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php diff --git a/backerymails.install b/backerymails.install index 801bd12..e5a33cb 100644 --- a/backerymails.install +++ b/backerymails.install @@ -5,6 +5,7 @@ * Contains backerymails.install. */ +use Symfony\Component\Yaml\Yaml; use Drupal\Core\Url; /** @@ -20,3 +21,24 @@ function backerymails_install() { $messenger = \Drupal::messenger(); $messenger->addMessage(t('Backery Mails settings are available under Administer > Site configuration > Backery Mails', ['@administer-page' => $url->toString()])); } + +/** + * Implementions of hook_update_N(). + */ + +/** + * Update Backerymails entity base table in order to fix typo in table name. + */ +function backerymails_update_8001() { + $type_manager = \Drupal::entityTypeManager(); + $type_manager->clearCachedDefinitions(); + $entity_type = $type_manager->getDefinition('backerymails_entity'); + \Drupal::entityDefinitionUpdateManager()->installEntityType($entity_type); + + // Update the existing backerymails views with the new base-table. + $config_path = drupal_get_path('module', 'backerymails') . '/config/install/views.view.backerymails.yml'; + $data = Yaml::parse(file_get_contents($config_path)); + \Drupal::configFactory()->getEditable('views.view.backerymails')->setData($data)->save(TRUE); + + return t('Backerymails base-table entity has been updated.'); +} diff --git a/backerymails.post_update.php b/backerymails.post_update.php new file mode 100644 index 0000000..7b2dad2 --- /dev/null +++ b/backerymails.post_update.php @@ -0,0 +1,39 @@ +schema()->tableExists('backerymails_sended_mail') && $database->schema()->tableExists('backerymails_sent_mails')) { + $query = $database->select('backerymails_sended_mail', 'sent_mails') + ->fields('sent_mails'); + $tuples = $query->execute()->fetchAll(); + foreach ($tuples as $tulpe) { + $database->insert('backerymails_sent_mails') + ->fields([ + 'module' => $tulpe->module, + 'module_key' => $tulpe->module_key, + 'mail_from' => $tulpe->mail_from, + 'mail_to' => $tulpe->mail_to, + 'mail_reply_to' => $tulpe->mail_reply_to, + 'langcode' => $tulpe->langcode, + 'subject' => $tulpe->subject, + 'body__value' => $tulpe->body__value, + 'body__format' => $tulpe->body__format, + 'created' => $tulpe->created, + ]) + ->execute(); + } + } + + $database->schema()->dropTable('backerymails_sended_mail'); +} diff --git a/config/install/views.view.backerymails.yml b/config/install/views.view.backerymails.yml index e36056d..79253af 100644 --- a/config/install/views.view.backerymails.yml +++ b/config/install/views.view.backerymails.yml @@ -10,7 +10,7 @@ label: Backerymails module: views description: Backerymails tag: backerymails -base_table: backerymails_sended_mail +base_table: backerymails_sent_mails base_field: id core: 8.x display: @@ -158,7 +158,7 @@ display: fields: id: id: id - table: backerymails_sended_mail + table: backerymails_sent_mails field: id relationship: none group_type: group @@ -224,7 +224,7 @@ display: plugin_id: field created: id: created - table: backerymails_sended_mail + table: backerymails_sent_mails field: created relationship: none group_type: group @@ -291,7 +291,7 @@ display: plugin_id: field module: id: module - table: backerymails_sended_mail + table: backerymails_sent_mails field: module relationship: none group_type: group @@ -356,7 +356,7 @@ display: plugin_id: field module_key: id: module_key - table: backerymails_sended_mail + table: backerymails_sent_mails field: module_key relationship: none group_type: group @@ -421,7 +421,7 @@ display: plugin_id: field mail_from: id: mail_from - table: backerymails_sended_mail + table: backerymails_sent_mails field: mail_from relationship: none group_type: group @@ -486,14 +486,14 @@ display: plugin_id: field mail_to: id: mail_to - table: backerymails_sended_mail + table: backerymails_sent_mails field: mail_to entity_type: backerymails_entity entity_field: mail_to plugin_id: field mail_reply_to: id: mail_reply_to - table: backerymails_sended_mail + table: backerymails_sent_mails field: mail_reply_to relationship: none group_type: group @@ -558,7 +558,7 @@ display: plugin_id: field langcode: id: langcode - table: backerymails_sended_mail + table: backerymails_sent_mails field: langcode relationship: none group_type: group @@ -623,7 +623,7 @@ display: plugin_id: field subject: id: subject - table: backerymails_sended_mail + table: backerymails_sent_mails field: subject relationship: none group_type: group diff --git a/src/Entity/BackerymailsEntity.php b/src/Entity/BackerymailsEntity.php index de64a40..a43988e 100644 --- a/src/Entity/BackerymailsEntity.php +++ b/src/Entity/BackerymailsEntity.php @@ -24,7 +24,7 @@ * }, * "access" = "Drupal\backerymails\BackerymailsEntityAccessControlHandler", * }, - * base_table = "backerymails_sended_mail", + * base_table = "backerymails_sent_mails", * admin_permission = "administer backerymails", * entity_keys = { * "id" = "id", diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-installed.php b/tests/fixtures/update/drupal-8.backerymails-entity-installed.php new file mode 100644 index 0000000000000000000000000000000000000000..f9304c2d0d53a7a59219b049e1665ac04716e916 GIT binary patch literal 20384 zcmeHPYj4{|7VT&M3PM;wc2GYgJ8>#+vu$3evCS5!-Tfqh7*iv8HWaCllw&u@f8TTN z9a5w$J9e!)a*_Z^$a&nkbLP&OJHtEr=f5VWleM+&?ck><9k^t4RG4I7vO#`0O47`} zcCkhFqepAOqu{3@-|+AvO$y_ZJQ$e5oS57OW-xGtOOaHh!62JXOuYGY>%?SsEB6w& z(9+iE&tRBlL1FU(jZs!{YJ=%yl$n7ICZ;&egLD`?H_=<0U5t&3^I)6~rm@{Z;qA4x zDH?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xkg3>cjl*EjL@7=d}o-*{JeH z$f{8Q2k1p*cPq^T5>8AODBKwTFs!G*n~z3(Z}PxH{kgtl&CfUq%Dh{Q;m6i3Z)TRE z+8Q&smA{K`aV=9T$$hl>`0lokwZHb_P8pAnn+=o9jS)u3Kxg_Rm9Ky(d0yW`Fk2bJ zjxgy6S0Zk37gi=!zM@xR{~GYh6E)noxWxTM@Wpw=r3%HVaszoYjZ#CsNX&E}4KKm) z{A7gt9rRWFBRxz$@{X1p@dw`ppy!KnO}@zTWgXYXJLhKrZs%L^v*=Yy<@K3gtk z;GjzKEkP@f3s)Ys@`Lqqk>hgE_#XbH!dIlr1rGC2a4XU;5iyB>T`pkYaSe+9V)0_M z|8g-yB(MjKvcEv!{JHjWQNz^qa_<4L`d+E_3qzaFbO*7%vH47$z++yvUT-&i<=Iax zw7(B#KMkb2g*Kh9DiOaB1lMdX35j$kCAkf6Qg96Lr(Nz1BbjnPDb1Fl z`S*)4TgB>luK=^n%AvW>mP^iu$=zo^Yo`m>c9mxgH=3wd&_+2^>-+p` z8(j8WEqCtMfqOMG*2t*r39jSvM>DSN#LWeY)OPLYZC)-}odl}|#}_yr40$8i;Aglp W+&C?yLVH>apN>!VP;>*oQ1^dts;mnD literal 0 HcmV?d00001 diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php b/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php new file mode 100644 index 0000000000000000000000000000000000000000..3f09aedfde010febc5dcf8d1b30188444e29867e GIT binary patch literal 20604 zcmeHPZExE~628y=6@+kr?4Y(I*-ldVnrrih3$DEawR@io5NmQJ?}Z{2l5*k}`S15U zGfRq;Wyh{%M^0QIwX`p@v(L^vJ6z7{AOD=3OxD)6w}T&}EOzPWpfqW0^0;_AO0(R) zafwCsqepAOqu|FOzv08nEG>;oiy$_oIW~n2OdPw?Whg4MAkL=~lWacQIySl8D!jxk zjI=fSBN%3RP}-uzV3bv!*kC#tRS#0@CeYkWld`ja zQTeB0u+#Hm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Q8krJjkiTvG;omXuRnIcUAf6mGyv#IUA|+vXQT@A0z-#;Oi)yvvJq8os;(>X;clRge0yfR(-W-@y*`IxSYxNUA?*j7xB|A(B>drwW@?#sOX?!#euolAJ}(G!jRpf>i^4xo5UMsD)XxeC!ib!rt)5sw{5 z^qCXPDmQGnFxQC9eZE5did^HZxfkh7#NdK7bE+gWjImi`43ueVW2^i#IbQcHo9pSd z4&IS_*ve&STLt&uRz{a34>JjgO9OkE%NM)-90Z!v3w4CmrYvS@k+SHutH4(c2Dxpr zq9;bk=EB7rc=j?<4%!l#8h<6WT96znMM6+j;wddzlS4nl1M>t!U+^|~Z*o0%dOO!T zT_OQAGM#3t%4;mE#tmGcm$lukG(AYZH0hyqWBiZlNhQAdbjuH>2t3qZ>h0RR$4Oqq zEhSNY>Rj`3XqBX{Ns(K{`{WuoL$#A!iJQ-C@A~_k=Po|9t|3*IK5EDR0@NJ8l}!sYtPG(e|4E%r(pZs|AeL7nTefa+^JB6#f+==MT%53>&=D3%&!$nomuQ-#glTuFn$d z8=KEH7(C=9^7U>jXl^{Tb-xQ{zf`2p4P8cIbs>JR2r=4R5egYsN^uuqr63vLzi#!E zAXSII{r;Lic_cNAue5`PSF=7fu*vcRZE4|QTR-7OPM!6{d_RfMjt>_ zA8g3JPkTslt;=TqwG3O`D!5yWIV!fuI|Z0y)?v+Ej$B39w>aHif6j_4n!C$+HqIF? zohnZouH>i}&_?B{%_sg#2VAzVR?qO4fqOACHpr-&3GN>A*FY|v#MK3g)NbPxZeA`~ modl~5$7eVy40-+8;8($NT(2#qLw8yZpN)@q(R2epnD>AEx%1Qj literal 0 HcmV?d00001 diff --git a/tests/fixtures/update/drupal-8.backerymails-installed.php b/tests/fixtures/update/drupal-8.backerymails-installed.php new file mode 100644 index 0000000..6a1ff02 --- /dev/null +++ b/tests/fixtures/update/drupal-8.backerymails-installed.php @@ -0,0 +1,44 @@ +merge('key_value') + ->fields([ + 'value' => 'i:8000;', + 'name' => 'backerymails', + 'collection' => 'system.schema', + ]) + ->condition('collection', 'system.schema') + ->condition('name', 'backerymails') + ->execute(); + +// Update core.extension. +$extensions = $connection->select('config') + ->fields('config', ['data']) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute() + ->fetchField(); +$extensions = unserialize($extensions); +$extensions['module']['backerymails'] = 8000; +$connection->update('config') + ->fields([ + 'data' => serialize($extensions), + 'collection' => '', + 'name' => 'core.extension', + ]) + ->condition('collection', '') + ->condition('name', 'core.extension') + ->execute(); + diff --git a/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php b/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php new file mode 100644 index 0000000..26d3c49 --- /dev/null +++ b/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php @@ -0,0 +1,97 @@ +databaseDumpFiles = [ + DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-typos-8001.php', + ]; + } + + /** + * {@inheritdoc} + */ + protected function doSelectionTest() { + parent::doSelectionTest(); + $this->assertSession()->responseContains('8001 - Update Backerymails entity base table in order to fix typo in table name.'); + } + + /** + * Tests backerymails_update_8001(). + * + * Ensure every existing entries in the old table are migrated. + * + * @see backerymails_update_8001() + */ + public function testUpdate8001() { + $database = Database::getConnection(); + + $this->assertFalse($database->schema()->tableExists('backerymails_sent_mails')); + $this->assertTrue($database->schema()->tableExists('backerymails_sended_mail')); + + $backerymails = BackerymailsEntity::loadMultiple(); + $this->assertCount(0, $backerymails); + + $database->insert('backerymails_sended_mail') + ->fields([ + 'module', + 'module_key', + 'mail_from', + 'mail_to', + 'mail_reply_to', + 'langcode', + 'subject', + 'body__value', + 'body__format', + ]) + ->values([ + 'backerymails.module', + 'backerymails.module_key', + 'backerymails.mail_from', + 'backerymails.mail_to', + 'backerymails.mail_reply_to', + 'en', + 'backerymails.subject', + 'backerymails.body', + null, + ]) + ->execute(); + + $this->assertEquals(1, $database->query('SELECT count(*) FROM {backerymails_sended_mail}')->fetchField()); + + $this->runUpdates(); + + $this->assertTrue($database->schema()->tableExists('backerymails_sent_mails')); + $this->assertFalse($database->schema()->tableExists('backerymails_sended_mail')); + + $this->assertEquals(1, $database->query('SELECT count(*) FROM {backerymails_sent_mails}')->fetchField()); + $backerymails = BackerymailsEntity::loadMultiple(); + $this->assertCount(1, $backerymails); + } + +} diff --git a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php new file mode 100644 index 0000000..739c364 --- /dev/null +++ b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php @@ -0,0 +1,94 @@ +databaseDumpFiles = [ + DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-installed.php', + ]; + } + + /** + * {@inheritdoc} + */ + protected function doSelectionTest() { + parent::doSelectionTest(); + $this->assertSession()->responseContains('8001 - Update Backerymails entity base table in order to fix typo in table name.'); + } + + /** + * Tests backerymails_update_8001(). + * + * Ensure when backerymails is installed for the first time with the proper + * base table name, the hook update does not generate errors. + * + * @see backerymails_update_8001() + */ + public function testUpdate8001() { + $database = Database::getConnection(); + + $this->assertTrue($database->schema()->tableExists('backerymails_sent_mails')); + $this->assertFalse($database->schema()->tableExists('backerymails_sended_mail')); + + + $database->insert('backerymails_sent_mails') + ->fields([ + 'module', + 'module_key', + 'mail_from', + 'mail_to', + 'mail_reply_to', + 'langcode', + 'subject', + 'body__value', + 'body__format', + ]) + ->values([ + 'backerymails.module', + 'backerymails.module_key', + 'backerymails.mail_from', + 'backerymails.mail_to', + 'backerymails.mail_reply_to', + 'en', + 'backerymails.subject', + 'backerymails.body', + null, + ]) + ->execute(); + + $this->runUpdates(); + + $this->assertTrue($database->schema()->tableExists('backerymails_sent_mails')); + $this->assertFalse($database->schema()->tableExists('backerymails_sended_mail')); + + $this->assertEquals(1, $database->query('SELECT count(*) FROM {backerymails_sent_mails}')->fetchField()); + $backerymails = BackerymailsEntity::loadMultiple(); + $this->assertCount(1, $backerymails); + } + +} From 0254dcee69b97f8328d36657cf1d44435857509b Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 1 May 2020 15:14:44 +0200 Subject: [PATCH 02/10] use a serial field for ID of backerymail entity in Updathpath tests --- ...drupal-8.backerymails-entity-installed.php | Bin 20384 -> 20361 bytes ...rupal-8.backerymails-entity-typos-8001.php | Bin 20604 -> 20581 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-installed.php b/tests/fixtures/update/drupal-8.backerymails-entity-installed.php index f9304c2d0d53a7a59219b049e1665ac04716e916..ba2304bb66fbd8d4e28bbb18129441d0426a2977 100644 GIT binary patch delta 31 ncmZ25pRsd3!x7FV3t=RadaJQ&7*#FUp;~(^Gl#H_yqe0BV^K ADF6Tf diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php b/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php index 3f09aedfde010febc5dcf8d1b30188444e29867e..2e38a9e9a3e523f6a87931768ae9d5f7218e1ac9 100644 GIT binary patch delta 31 ncmeyffbr=9#tjp_Sc+4NGAAGNQl2d4BQSZj7uV*OUXxh?;Vun9 delta 30 ocmV+(0O9}TpaJ}#0kDxuljTnu15{E~lg>^dlb%W%v(ieF1>4&VS^xk5 From 0b2d73e4fb8cb506bfe956b5927e48a8df31e18e Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 1 May 2020 15:22:21 +0200 Subject: [PATCH 03/10] ensure update is available --- .../Update/RenameAndMigrateEntityTableUpdate8001Test.php | 2 +- .../Update/SkipEntityTableUpdate8001WhenExistingTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php b/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php index 26d3c49..a5f12e8 100644 --- a/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php +++ b/tests/src/Functional/Update/RenameAndMigrateEntityTableUpdate8001Test.php @@ -38,7 +38,7 @@ protected function setDatabaseDumpFiles() { */ protected function doSelectionTest() { parent::doSelectionTest(); - $this->assertSession()->responseContains('8001 - Update Backerymails entity base table in order to fix typo in table name.'); + $this->assertSession()->responseContains('Update Backerymails entity base table in order to fix typo in table name.'); } /** diff --git a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php index 739c364..059413a 100644 --- a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php +++ b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php @@ -38,7 +38,7 @@ protected function setDatabaseDumpFiles() { */ protected function doSelectionTest() { parent::doSelectionTest(); - $this->assertSession()->responseContains('8001 - Update Backerymails entity base table in order to fix typo in table name.'); + $this->assertSession()->responseContains('Update Backerymails entity base table in order to fix typo in table name.'); } /** From dc0297acaa22348575770cd93c76b43c612bef92 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 1 May 2020 15:52:11 +0200 Subject: [PATCH 04/10] update travis integration (#19) --- .travis.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b4eab7..3cabf11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,18 +8,16 @@ language: php sudo: false php: - - 7.1 + - 7.3 services: - mysql matrix: include: - - name: PHP 7.1 & MySQL 5.7, D8.7 - php: 7.1 + - name: D8.7 env: DRUPAL_TI_RUNNERS="phpunit-core" DRUPAL_TI_CORE_BRANCH="8.7.x" - - name: PHP 7.1 & MySQL 5.7, D8.8 - php: 7.1 + - name: D8.8 env: DRUPAL_TI_RUNNERS="phpunit-core" DRUPAL_TI_CORE_BRANCH="8.8.x" env: @@ -42,7 +40,7 @@ env: - DRUPAL_TI_ENVIRONMENT="drupal-8" # The drush version to use, by default: drush/drush:8.0.* - # - DRUPAL_TI_DRUSH_VERSION="drush/drush:~9.0" + - DRUPAL_TI_DRUSH_VERSION="drush/drush:^10.1.1" # Switch to 8.7.x versions instead of 8.1.x by default. - DRUPAL_TI_CORE_BRANCH="8.7.x" @@ -78,6 +76,7 @@ env: - DRUPAL_TI_BEHAT_BROWSER="firefox" # PHPUnit specific commandline arguments. + - DRUPAL_TI_PHPUNIT_VERSION="^7.0" - DRUPAL_TI_PHPUNIT_ARGS="" # Specifying the phpunit-core src/ directory is useful when e.g. a vendor/ # directory is present in the module directory, which phpunit would then @@ -113,7 +112,9 @@ mysql: before_install: - composer self-update - cd ./tests - - composer global require "lionsad/drupal_ti:dev-master#9f26af8" + - composer global config repositories.repo-name git https://github.com/wengerk/drupal_ti + - composer global require "lionsad/drupal_ti:dev-add-drupal-9-support" +# - composer global require "lionsad/drupal_ti:dev-master" - drupal-ti before_install install: From f06514c3172a51335d763b199e6b4ac5d1f675e4 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 14:16:21 +0200 Subject: [PATCH 05/10] Update tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php --- .../Update/SkipEntityTableUpdate8001WhenExistingTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php index 059413a..d534fa4 100644 --- a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php +++ b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php @@ -7,7 +7,7 @@ use Drupal\FunctionalTests\Update\UpdatePathTestBase; /** - * Tests Backerymails entity base-table renamed and migrated. + * Ensure hook_update_8001 does not create error on fresh install with proper table name. * * @group backerymails * @group legacy From c084713af690fc6b395abb611acedaa35b9a2757 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 14:17:08 +0200 Subject: [PATCH 06/10] Update backerymails.post_update.php Co-authored-by: Gilles Doge --- backerymails.post_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backerymails.post_update.php b/backerymails.post_update.php index 7b2dad2..16596b0 100644 --- a/backerymails.post_update.php +++ b/backerymails.post_update.php @@ -10,7 +10,7 @@ /** * Migrate data from the old existing Backerymails table to the new one. */ -function backerymails_post_update_migrate_data(&$sandbox = NULL) { +function backerymails_post_update_8001_migrate_data(&$sandbox = NULL) { $database = Database::getConnection(); if ($database->schema()->tableExists('backerymails_sended_mail') && $database->schema()->tableExists('backerymails_sent_mails')) { From 9af836629aff141a90b6d3278f5fcfa042c7fa2c Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 17:23:52 +0200 Subject: [PATCH 07/10] improve developping explaination --- DEVELOPPING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DEVELOPPING.md b/DEVELOPPING.md index 4fae775..926310c 100644 --- a/DEVELOPPING.md +++ b/DEVELOPPING.md @@ -34,11 +34,11 @@ Once run, you will be able to access to your fresh installed Drupal on `localhos docker-compose build --pull --build-arg BASE_IMAGE_TAG=8.9 drupal (get a coffee, this will take some time...) docker-compose up -d drupal - docker-compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" --site-name=Example -y + docker-compose exec -u www-data drupal drush site-install standard --db-url="mysql://drupal:drupal@db/drupal" -y # You may be interesed by reseting the admin passowrd of your Docker and install the module using those cmd. docker-compose exec drupal drush user:password admin admin - docker-compose exec drupal drush en backerymails + docker-compose exec drupal drush en backerymails -y ## 🏆 Tests From e0e36cc3a37fd5f03ada9829a1bf025c255766fc Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 17:24:58 +0200 Subject: [PATCH 08/10] ensure entity/table rename works as expected --- backerymails.install | 9 ++ backerymails.post_update.php | 32 +++--- src/Entity/BackerymailsEntity.php | 13 +-- ...drupal-8.backerymails-entity-installed.php | Bin 20361 -> 20091 bytes ...rupal-8.backerymails-entity-typos-8001.php | Bin 20581 -> 20192 bytes .../drupal-8.backerymails-installed.php | 2 +- ...ameAndMigrateEntityTableUpdate8001Test.php | 30 ++++-- ...pEntityTableUpdate8001WhenExistingTest.php | 94 ------------------ 8 files changed, 49 insertions(+), 131 deletions(-) delete mode 100644 tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php diff --git a/backerymails.install b/backerymails.install index e5a33cb..9be10db 100644 --- a/backerymails.install +++ b/backerymails.install @@ -7,6 +7,7 @@ use Symfony\Component\Yaml\Yaml; use Drupal\Core\Url; +use Drupal\Core\Database\Database; /** * Implements hook_install(). @@ -30,6 +31,14 @@ function backerymails_install() { * Update Backerymails entity base table in order to fix typo in table name. */ function backerymails_update_8001() { + $database = Database::getConnection(); + + // Delete all old backerymails entity definition. + $database->delete('key_value') + ->condition('name', 'backerymails_entity.%', 'LIKE') + ->execute(); + + // Re-install the new entity that will generate a new table. $type_manager = \Drupal::entityTypeManager(); $type_manager->clearCachedDefinitions(); $entity_type = $type_manager->getDefinition('backerymails_entity'); diff --git a/backerymails.post_update.php b/backerymails.post_update.php index 16596b0..ecb6fce 100644 --- a/backerymails.post_update.php +++ b/backerymails.post_update.php @@ -16,24 +16,24 @@ function backerymails_post_update_8001_migrate_data(&$sandbox = NULL) { if ($database->schema()->tableExists('backerymails_sended_mail') && $database->schema()->tableExists('backerymails_sent_mails')) { $query = $database->select('backerymails_sended_mail', 'sent_mails') ->fields('sent_mails'); + + $backerymails_storage = \Drupal::service('entity_type.manager')->getStorage('backerymails_entity'); $tuples = $query->execute()->fetchAll(); foreach ($tuples as $tulpe) { - $database->insert('backerymails_sent_mails') - ->fields([ - 'module' => $tulpe->module, - 'module_key' => $tulpe->module_key, - 'mail_from' => $tulpe->mail_from, - 'mail_to' => $tulpe->mail_to, - 'mail_reply_to' => $tulpe->mail_reply_to, - 'langcode' => $tulpe->langcode, - 'subject' => $tulpe->subject, - 'body__value' => $tulpe->body__value, - 'body__format' => $tulpe->body__format, - 'created' => $tulpe->created, - ]) - ->execute(); + $backerymails_storage->create([ + 'module' => $tulpe->module, + 'module_key' => $tulpe->module_key, + 'mail_from' => $tulpe->mail_from, + 'mail_to' => $tulpe->mail_to, + 'mail_reply_to' => $tulpe->mail_reply_to, + 'langcode' => $tulpe->langcode, + 'subject' => $tulpe->subject, + 'body__value' => $tulpe->body__value, + 'body__format' => $tulpe->body__format, + 'created' => $tulpe->created, + ])->save(); } - } - $database->schema()->dropTable('backerymails_sended_mail'); + $database->schema()->dropTable('backerymails_sended_mail'); + } } diff --git a/src/Entity/BackerymailsEntity.php b/src/Entity/BackerymailsEntity.php index a43988e..ad8f9ae 100644 --- a/src/Entity/BackerymailsEntity.php +++ b/src/Entity/BackerymailsEntity.php @@ -28,6 +28,8 @@ * admin_permission = "administer backerymails", * entity_keys = { * "id" = "id", + * "label" = "subject", + * "langcode" = "langcode", * }, * links = { * "canonical" = "/admin/config/backerymails/mails/{backerymails_entity}", @@ -134,12 +136,6 @@ public function getBody() { public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields = parent::baseFieldDefinitions($entity_type); - $fields['id'] = BaseFieldDefinition::create('integer') - ->setLabel(t('Entity ID')) - ->setDescription(t('The entity ID for this menu link content entity.')) - ->setReadOnly(TRUE) - ->setSetting('unsigned', TRUE); - $fields['module'] = BaseFieldDefinition::create('string') ->setLabel(t('Module')) ->setDescription(t('The module that send the mail.')); @@ -160,11 +156,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setLabel(t('Reply-to')) ->setDescription(t('The reply-to(s) of the mail.')); - $fields['langcode'] = BaseFieldDefinition::create('string') - ->setLabel(t('Langcode')) - ->setSetting('max_length', 12) - ->setDescription(t('The langcode of the mail.')); - $fields['subject'] = BaseFieldDefinition::create('string') ->setLabel(t('Subject')) ->setDescription(t('The subject of the mail.')); diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-installed.php b/tests/fixtures/update/drupal-8.backerymails-entity-installed.php index ba2304bb66fbd8d4e28bbb18129441d0426a2977..5690c79cc31ff95a6a96e08208373e47a1d7ad28 100644 GIT binary patch delta 863 zcmZ`%L2DC16lONDQW}E9hNz_))?!dh-0UWs?Z%iM^iV1}2%g#+HrYusahsHE(qhY^ z;z7J<<>^6b5D)6jw#=zl5f4I1rGj2O2-2f}pciKnOr)&0{l5L)_uhQ(J$i)>*3sH6 zj~0`*=D#B(fhx?xZ{hY#N?)~gSr>^ZrvLd!>Y`;7u*J!gF50a^6&ITvY5Y&ET&$b; z5CqE;qnjQ9p(Lf=Dx#GkKcY{MM!ZOd?U4*j_)d5veU)0iC*C1hpA)CA!bb2ioD8&& z+j?AK45^VOF|7QOVYQ%me%_}slJ{#FWen|57JNzoO3FDQF2k1pm!PO{e>57JWU>;$ zmYF9_yrB0h_O&FuI93?pHrIPL@IIKin_}1`_M&CnnG@3nOMu0YVB`|P%UveU87`|Y zHc7o^4@i}f4P0g<<7}P73NcO0q2u&yO7+IVpyIHN3^$d)g(NHdJ80g<77Ms`hjzIJxaUD%oUhCH&wchwtmC$jFY+>bKL#NahQr2kl! zWmP~4W_S@kCvx36SCS9iO%K#}2=0x>U{{;zDxJwT8h1H4%o5MBB|0K(Okw&U{nI@(o7^^MRfP#zZBpI7+HnVkiQ%Lln zAgCZ39Q9-oFXGWMhn~FkQi_6?3cU$lMeyRG3QjjGg&ybq|L?uuf8NGxc>D%BHy6ua z0b)#*ZlJiL$~}=Di`;JN7O75=dEM4cdWAT+iXA-8u1oJB#lUxfP5L6cGpcN0I#V&L zyy4pekm7g!vrw>AMab}v&+ z2y{&@)(GkX3kiu-$f@ZzY7p8)B4`~|y1PBo^YAFkhZcB#{|ZR)EISt;W*ziOeBN{f z^Tfdyz`un*gOrYKlhy{_0e?C438ZLpoAl`LQ{W>i}Ol{snwWTG{gR z>BwJT8=-6L$52~RVr=%%Z*k)f{r2XgFEZh_lbx5l=Oh2K_QjH3R`0Nc-9Pz&t?!%S z^TVqmNqTFCn`CB0><=kX38F%2dsKsohrmB3-vV3gKgFJ;$Gv(svjF^O_ELal&-C)b M+2Ss~ba6TG4|qV{QUCw| diff --git a/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php b/tests/fixtures/update/drupal-8.backerymails-entity-typos-8001.php index 2e38a9e9a3e523f6a87931768ae9d5f7218e1ac9..3836d3254d8f07b6e884bd4efc2010c1180cf804 100644 GIT binary patch delta 482 zcmYk2KS&#K6vuscS7MCdKO~Js30H;qFWz}1x%?u6APyZwaJJ!R?x=_HqPbgw910HI zH29<-v=Rrq7JZALlZ%L;ND&-e#HEWM&gP8Jtl#%}pZDcGRN(#>l)s94TsfTU6$DMk z4WUm|*edDbkr>w4s>9Mu&T+e7TREPWGY(5=2!Y;^W7>vkWS6*=M>R0n?ywY-4a-^1 z^OBDxbsv-Ku&imjmRs^hmblHonZxfeI)N8jZ_J3G;%O){=s8T)nA|YXzzxH4t%B{} zr!`9mDk_!9R86evD_S`f6W`>wmMHYttUVS?H3?uX>5y} zK@vgbw9~l*G!ecA7_CbaUB7{zKV1PN>e9!aO`y%_WmTcq#cQ9-K(W5RP%Zsm9F6@1 zy6wLNP_Q*p#Ezkv+DVMYB)S;d0$Pdts#I->Kz#xVX^MdRgTuIxn0{~gG5HlcDuq|W?$Qyz04%F zsic=!&BJ+0{x9D1&#V4x?QQH(Ca`smV2g^f;1+cPJHw`G#gD7=iKKcJA61jx>&dnc zE+lhB02N8vAKo(-D;Z%fgWyRaxvWi;sF-Iq&QF6*2I98MH-vPl@Eq`5bl64C92<-W zi~-C<8FYobzJtK4E!ffyywg_Y^K zb`J!>&x|a)be?VZ{qcPdVkoD6AEy4mf%hm00|uGHTyV*$Q>ap>;;;35LYkRY&5Aguq%c0sKUUJdg#POIpF-k~N!W=FzAdIuv*dR7Y)o>9My=}`BD z*@)I1$gY4916databaseDumpFiles = [ - DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-typos-8001.php', - ]; + // This conditional allows tests to pass both before and after 8.8.x. The + // 8.4.0 fixtures were removed in 8.8.x. + // https://www.drupal.org/project/consumers/issues/3115996 + // @todo: Remove this conditional after 8.7.x is no longer supported. + + if (file_exists(DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz')) { + $this->databaseDumpFiles = [ + DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-typos-8001.php', + ]; + } + else { + $this->databaseDumpFiles = [ + // @todo: Remove this fixture after 8.7 is no longer supported. + DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', + __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-typos-8001.php', + ]; + } } /** @@ -53,9 +68,7 @@ public function testUpdate8001() { $this->assertFalse($database->schema()->tableExists('backerymails_sent_mails')); $this->assertTrue($database->schema()->tableExists('backerymails_sended_mail')); - - $backerymails = BackerymailsEntity::loadMultiple(); - $this->assertCount(0, $backerymails); + $this->assertEquals(0, $database->query('SELECT count(*) FROM {backerymails_sended_mail}')->fetchField()); $database->insert('backerymails_sended_mail') ->fields([ @@ -81,7 +94,6 @@ public function testUpdate8001() { null, ]) ->execute(); - $this->assertEquals(1, $database->query('SELECT count(*) FROM {backerymails_sended_mail}')->fetchField()); $this->runUpdates(); diff --git a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php b/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php deleted file mode 100644 index d534fa4..0000000 --- a/tests/src/Functional/Update/SkipEntityTableUpdate8001WhenExistingTest.php +++ /dev/null @@ -1,94 +0,0 @@ -databaseDumpFiles = [ - DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz', - __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-installed.php', - __DIR__ . '/../../../fixtures/update/drupal-8.backerymails-entity-installed.php', - ]; - } - - /** - * {@inheritdoc} - */ - protected function doSelectionTest() { - parent::doSelectionTest(); - $this->assertSession()->responseContains('Update Backerymails entity base table in order to fix typo in table name.'); - } - - /** - * Tests backerymails_update_8001(). - * - * Ensure when backerymails is installed for the first time with the proper - * base table name, the hook update does not generate errors. - * - * @see backerymails_update_8001() - */ - public function testUpdate8001() { - $database = Database::getConnection(); - - $this->assertTrue($database->schema()->tableExists('backerymails_sent_mails')); - $this->assertFalse($database->schema()->tableExists('backerymails_sended_mail')); - - - $database->insert('backerymails_sent_mails') - ->fields([ - 'module', - 'module_key', - 'mail_from', - 'mail_to', - 'mail_reply_to', - 'langcode', - 'subject', - 'body__value', - 'body__format', - ]) - ->values([ - 'backerymails.module', - 'backerymails.module_key', - 'backerymails.mail_from', - 'backerymails.mail_to', - 'backerymails.mail_reply_to', - 'en', - 'backerymails.subject', - 'backerymails.body', - null, - ]) - ->execute(); - - $this->runUpdates(); - - $this->assertTrue($database->schema()->tableExists('backerymails_sent_mails')); - $this->assertFalse($database->schema()->tableExists('backerymails_sended_mail')); - - $this->assertEquals(1, $database->query('SELECT count(*) FROM {backerymails_sent_mails}')->fetchField()); - $backerymails = BackerymailsEntity::loadMultiple(); - $this->assertCount(1, $backerymails); - } - -} From 18f156e038fbc979001db38eff42c17111c0b7e1 Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 17:25:14 +0200 Subject: [PATCH 09/10] remove drupal 8.8+ core:8.x on views --- config/install/views.view.backerymails.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/install/views.view.backerymails.yml b/config/install/views.view.backerymails.yml index 79253af..02923b8 100644 --- a/config/install/views.view.backerymails.yml +++ b/config/install/views.view.backerymails.yml @@ -12,7 +12,6 @@ description: Backerymails tag: backerymails base_table: backerymails_sent_mails base_field: id -core: 8.x display: default: display_plugin: default From 62b166a3376d886e420bba61ee034628ced9d62a Mon Sep 17 00:00:00 2001 From: Kevin Wenger Date: Fri, 24 Jul 2020 17:32:45 +0200 Subject: [PATCH 10/10] add backlinking to hook_update from post_update --- backerymails.post_update.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backerymails.post_update.php b/backerymails.post_update.php index ecb6fce..a3335b1 100644 --- a/backerymails.post_update.php +++ b/backerymails.post_update.php @@ -9,6 +9,8 @@ /** * Migrate data from the old existing Backerymails table to the new one. + * + * @see backerymails_update_8001() */ function backerymails_post_update_8001_migrate_data(&$sandbox = NULL) { $database = Database::getConnection();