Postponed on #2687843: Add back incremental migrations through the UI

Problem/Motivation

A review of the patch in #2687843: Add back incremental migrations through the UI comment #98 included some points that were outside the scope of the issue and need to be addressed.

The relevant is in comment#99

This is a copy of the points to be addressed in this issue

Now in IncrementalForm.
2.    +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
    @@ -236,6 +244,51 @@ public function submitOverviewForm(array &$form, FormStateInterface $form_state)
    +    $database_state_key = $this->state->get('migrate.fallback_state_key', '');
    +    if ($database_state_key) {

    Why would we use the fallback state key here? The user has entered explicit database credentials here, so I don't understand why we wouldn't just use those.

Now in OverviewForm.
3.    +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
    @@ -236,6 +244,51 @@ public function submitOverviewForm(array &$form, FormStateInterface $form_state)
    +      $form_state->setValue('step', 'credentials');
    +      $form_state->setRebuild();

    Nit: setValue() is chainable, so we could do ->setValue()->setRebuild().

Now in MigrateUPgradeFormBase.
4.    +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
    @@ -848,6 +877,44 @@ protected function getDatabaseTypes() {
    +   * Setup migrations.
    +   *
    +   * @param array $database
    +   *   Database array representing the source Drupal database.
    +   * @param \Drupal\Core\Form\FormStateInterface $form_state
    +   *   The current state of the form.
    +   */
    +  protected function setupMigrations(array $database, FormStateInterface $form_state) {

    Can this doc comment be expanded a bit? "Setup migrations" tells me nothing more than the method name already does.

Now in  CredentialForm.
5.    +++ b/core/modules/migrate_drupal_ui/src/Form/MigrateUpgradeForm.php
    @@ -848,6 +877,44 @@ protected function getDatabaseTypes() {
    +    $form_state->set('version', $version);
    +    $form_state->set('migrations', $migration_array);

    Nit: ->set() is chainable.

10.     +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
    @@ -315,4 +281,110 @@ protected function translatePostValues(array $values) {
    +   * @param $session
    +   *   The currenct session.

    $session needs a type hint (also in the method signature), and there's a typo in 'current'.

11.    +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
    @@ -315,4 +281,110 @@ protected function translatePostValues(array $values) {
    +   * @param $session
    +   *   The currenct session.
    +   */
    +  protected function assertIdConflict($session) {

    $session needs to be type hinted, and 'current' is misspelled. :)

12.    +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
    @@ -315,4 +281,110 @@ protected function translatePostValues(array $values) {
    +    // Have to reset all the statics after migration to ensure entities are

    'statics' should be 'static caches'.

Proposed resolution

2. The section of code is being removed in #2679835: Improve exception handling in Migrate UI

3. It is no longer relevant, the form step is stored in temp private store.

4. Already fixed in another issue.

5. These lines are no longer in the code and the form uses the temp private store for form information.

10. Already fixed in another issue.

11. Already fixed in another issue.

Remaining tasks

12. Fixed in this issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Title: Add back incremental migrations through the UI » Fixes for MigrateUpgradeForm
Issue tags: -Migrate January 2017 Sprint +Migrate January 2018 Sprint

Remove the duplicate title and correct the year in the tag.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

heddn’s picture

Status: Postponed » Active

No longer blocked.

quietone’s picture

Issue tags: +Migrate UI

Tagging

quietone’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
728 bytes

Since this issue was created the UpgradeForm has been split into several files. The IS is updated to include the file where the code now resides, if it has moved..

2. The section of code is being removed in #2679835: Improve exception handling in Migrate UI

3. It is no longer relevant, the form step is stored in temp private store.

4. Already fixed in another issue.

5. These lines are no longer in the code and the form uses the temp private store for form information.

10. Already fixed in another issue.

11. Already fixed in another issue.

12. Fixed in this patch.

quietone’s picture

Status: Needs review » Needs work
+++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
@@ -179,7 +179,7 @@ public function testMigrateUpgrade() {
+    // Have to reset all the static caches after migration to ensure entities are

line longer than 80 characters

RytoEX’s picture

Status: Needs work » Needs review
FileSize
796 bytes
802 bytes

Addressed #7 to keep this going. Interdiff is nearly identical, but attached here anyway.

heddn’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Updated the IS to basically copy from #6. And that means this is RTBC.

alexpott’s picture

Title: Fixes for MigrateUpgradeForm » Docs fix in MigrateUpgradeForm
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed c5187032aa to 8.6.x and a9d737163e to 8.5.x. Thanks!

btw. I would have removed the "Have to" since that is redundant.

  • alexpott committed c518703 on 8.6.x
    Issue #2936002 by RytoEX, quietone: Docs fix in MigrateUpgradeForm
    

  • alexpott committed a9d7371 on 8.5.x
    Issue #2936002 by RytoEX, quietone: Docs fix in MigrateUpgradeForm
    
    (...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.