See parent issue #2181257: [meta] Variables to config migration [d7] for instructions.

CommentFileSizeAuthor
#68 variable_to_config-2409453-68.patch3.68 KBhussainweb
#68 interdiff-64-68.txt667 byteshussainweb
#65 interdiff-54-64.txt933 byteshussainweb
#64 variable_to_config-2409453-64.patch2.69 KBhussainweb
#64 variable_to_config-2409453-64.patch2.69 KBhussainweb
#57 tests.results.txt130.14 KBvprocessor
#54 Variable_to_config_statistics_settings-2409453-54.patch3.75 KBvprocessor
#54 Variable_to_config_statistics_settings-2409453-54.interdiff.txt665 bytesvprocessor
#50 Variable_to_config_statistics_settings-2409453-49.patch3.75 KBvprocessor
#41 interdiff-2409453-38-41.txt4.34 KBquietone
#41 2409453-41.patch3.72 KBquietone
#38 interdiff-2409453-37-38.txt2.51 KBquietone
#38 2409453-38.patch2.47 KBquietone
#37 2409453-37.patch5.54 KBquietone
#34 2409453-34.patch9.16 KBquietone
#31 2409453-31.patch9.04 KBquietone
#31 interdiff-2409453-27-31.txt3.48 KBquietone
#27 2409453-27.patch9.38 KBquietone
#23 interdiff-2409453-21-23.txt1.45 KBquietone
#23 2409453-23.patch8.58 KBquietone
#21 2409453-21.patch8.5 KBquietone
#12 interdiff-2409453-9-12.txt461 bytesphenaproxima
#12 2409453-12.patch5.93 KBphenaproxima
#9 interdiff-2409453-8-9.txt5.34 KBphenaproxima
#9 2409453-9.patch5.33 KBphenaproxima
#8 2409453-8.patch4.79 KBphenaproxima
#6 2409453-6.patch3.19 KBphenaproxima
#5 2409453-5.patch3.42 KBphenaproxima
#1 statistics_settings-2409453-1.patch1.15 KBhosef
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hosef’s picture

Status: Active » Needs work
Issue tags: +Needs tests
FileSize
1.15 KB

Attached is the YAML for this issue, from the patch in #2382117: Migration Files for Drupal 7 Variables.
Test(s) (and maybe a dump file) still need to be written.

miguelc303’s picture

Added organization support to Anexus IT

jcost’s picture

Project: IMP » Drupal core
Version: » 8.0.x-dev
Component: Code » migration system

Will need to be submitted again to Core since moving from sandbox.

phenaproxima’s picture

phenaproxima’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
3.42 KB

Added a test and removed the migration settings for the popular block, since they don't seem to live in the statistics.settings config object anymore.

phenaproxima’s picture

Re-rolled. No interdiff due to conflicts with the {variable} dump.

chx’s picture

Status: Needs review » Needs work

Six variables as source and only three has process and test. statistics_flush_accesslog_timer is an integer (the default integer) in D6 but a string in D7 and somehow it doesn't blow up here? What happened to the famous config schema? At least assertIdentical please.

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
4.79 KB

Re-rolled, but also changed -- thanks to @chx I noticed that a few statistics-related variables belong in a different config object, so I wrote a separate migration and test for that. I also noticed that the statistics.settings migration is identical in D6 and D7, so I condensed them into a single one (the test of which uses the Drupal 6 source data).

Unfortunately, I can't provide an interdiff due to conflicts with the variable.php dump file.

phenaproxima’s picture

On second thought...looks like D6 maintains the same exact set of Statistics-related variables that D7 does. So I've generalized both Statistics migrations.

The last submitted patch, 8: 2409453-8.patch, failed testing.

Status: Needs review » Needs work

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

phenaproxima’s picture

Status: Needs work » Needs review
FileSize
5.93 KB
461 bytes

Hm. Well, this one, at least, passes on my local machine.

mikeryan’s picture

Status: Needs review » Reviewed & tested by the community

sharing++

The last submitted patch, 1: statistics_settings-2409453-1.patch, failed testing.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok awesome, onward!

Committed and pushed to 8.0.x. Thanks!

  • webchick committed f541fae on 8.0.x
    Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
webchick’s picture

  • webchick committed 5d0772b on 8.0.x
    Revert "Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...

quietone queued 12: 2409453-12.patch for re-testing.

The last submitted patch, 12: 2409453-12.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
8.5 KB

Reroll.

Status: Needs review » Needs work

The last submitted patch, 21: 2409453-21.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
8.58 KB
1.45 KB

I updated the d6 dumps not the d7 dumps and missed that. Sigh.
There will still be a failure with the schema.

Status: Needs review » Needs work

The last submitted patch, 23: 2409453-23.patch, failed testing.

The last submitted patch, 21: 2409453-21.patch, failed testing.

The last submitted patch, 23: 2409453-23.patch, failed testing.

quietone’s picture

Enabled statistics and the popular block and D8 and discovered that this is saving to the wrong configuration. It should be saving to an array, settings, in block.block.popular.content not block.settings.statistics_popular_block. Fixed that up and the test now fails on ConfigSchemaChecker , 'No schema for block.block.popularcontent'. Fine, that makes sense. Unfortunately, installing the block config doesn't install block.block.popularcontent.

Looked at the block migration and see that the statistics block is not migrated in that test. So no quick answer there.

How do we handle this case?

quietone’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 27: 2409453-27.patch, failed testing.

The last submitted patch, 27: 2409453-27.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
3.48 KB
9.04 KB

Put a langcode entry in the schema and the tests passed locally. But, not convinced this is correct, don't really know enough about the config system. And puzzled by the relevance of the comment in StatisticsReportsTest.php that " statistics.module doesn't use node entities, prevent the node language from being added to the options.".

Status: Needs review » Needs work

The last submitted patch, 31: 2409453-31.patch, failed testing.

The last submitted patch, 31: 2409453-31.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
9.16 KB

Forgot to build the dump files.

mikeryan queued 34: 2409453-34.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 34: 2409453-34.patch, failed testing.

quietone’s picture

Status: Needs work » Needs review
FileSize
5.54 KB

Simply a reroll.

quietone’s picture

This patch has actually 2 parts, one is migrating statistics variables and the other is migrating the statistics block variables. The first part is straight forward and working fine but the second isn't. It will require more work and an better understanding of block migrations than I have. It makes better sense to me to move that statistics block work to a new issue. At minimum a new issue title will better identify what need to be done.

The attached patch removes everything related to the statistics block variables.

quietone’s picture

mikeryan’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/statistics/config/schema/statistics.schema.yml
    @@ -25,6 +25,9 @@ block.settings.statistics_popular_block:
    +    langcode:
    +      type: string
    +      label: 'Language code'
    

    This belongs with the separated-out block issue, no? If it belongs in a migration patch at all...

  2. +++ b/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsConfigsTest.php
    @@ -2,10 +2,10 @@
     use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
    

    This is just going to run for D6, we should also test on D7 (i.e., keep the d6 test and make a dupe-except-for-the-base-class in the d7 directory).

quietone’s picture

Status: Needs work » Needs review
FileSize
3.72 KB
4.34 KB

1. Wow that was an oversight
2. D7 test file created.

Thx, mikeryan.

  • webchick committed 5d0772b on 8.1.x
    Revert "Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
  • webchick committed f541fae on 8.1.x
    Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
quietone’s picture

Issue tags: +migrate-d7-d8
benjy’s picture

The last patch looks good but I note that previous patches had changes to the dumps, did something change there?

quietone’s picture

The changes to the dumps were about the statistics block settings. That work was moved to #2613870: Variable to config: statistics block settings [d7] because they have a different config destination. Looks like that happened in #38.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Status: Needs review » Needs work

The last submitted patch, 41: 2409453-41.patch, failed testing.

quietone’s picture

Issue tags: +Needs reroll
vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Assigned: vprocessor » Unassigned
Status: Needs work » Needs review
FileSize
3.75 KB

rerolled

vprocessor’s picture

Issue tags: -Needs reroll

Status: Needs review » Needs work

The last submitted patch, 50: Variable_to_config_statistics_settings-2409453-49.patch, failed testing.

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Status: Needs review » Needs work

The last submitted patch, 54: Variable_to_config_statistics_settings-2409453-54.patch, failed testing.

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Assigned: vprocessor » Unassigned
FileSize
130.14 KB

Sorry guys, don't understand this issue.

On my local all tests passed

Console command: php core/scripts/run-tests.sh --color --concurrency 2 --verbose --sqlite ~/tmpfs/drupal/test.sqlite --url http://d8.lc/ --class '\Drupal\migrate_drupal_ui\Tests\d7\MigrateUpgrade7Test'

Please, check results in attached file

Code which generated this issue: $this->assertText(t('Congratulations, you upgraded Drupal!'));

quietone’s picture

@vprocessor, thanks for working on this. I don't know why that test is failing, maybe the testbot had a hiccup.

Just two items,

  1. +++ b/core/modules/statistics/src/Tests/Migrate/d7/MigrateStatisticsConfigsTest.php
    @@ -0,0 +1,46 @@
    +namespace Drupal\statistics\Tests\Migrate\d7;
    

    This should be in tests/src/Kernel/Migrated/d7, similar to d6/MigrateStatisticsConfigtsTest.php

  2. +++ b/core/modules/statistics/src/Tests/Migrate/d7/MigrateStatisticsConfigsTest.php
    @@ -0,0 +1,46 @@
    +/**
    + * @file
    + * Contains \Drupal\statistics\Tests\Migrate\d7\MigrateStatisticsConfigsTest.
    + */
    

    This isn't needed. See the d6/MigrateStatisticsConfigtsTest.php for an example.

vprocessor’s picture

Assigned: Unassigned » vprocessor
vprocessor’s picture

Status: Needs work » Needs review
mikeryan’s picture

@vprocessor - did you mean to upload a new patch responding to @quietone's comments?

  • webchick committed f541fae on 8.3.x
    Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
  • webchick committed 5d0772b on 8.3.x
    Revert "Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...

  • webchick committed f541fae on 8.3.x
    Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
  • webchick committed 5d0772b on 8.3.x
    Revert "Issue #2409453 by phenaproxima, hosef, chx: Variable to config:...
hussainweb’s picture

One of those issues where the interdiff is harder to create than the patch.

Addressing comments in #58.

hussainweb’s picture

FileSize
933 bytes

I was sure I had uploaded the interdiff. Anyway, here it is...

The last submitted patch, 64: variable_to_config-2409453-64.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 64: variable_to_config-2409453-64.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
667 bytes
3.68 KB
vprocessor’s picture

Assigned: vprocessor » Unassigned
hussainweb’s picture

I requeued the patch for testing and it still passes.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Seems pretty straightforward.

phenaproxima’s picture

Version: 8.2.x-dev » 8.3.x-dev
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 3fff17d to 8.3.x and 5817330 to 8.2.x. Thanks!

  • alexpott committed 3fff17d on 8.3.x
    Issue #2409453 by quietone, phenaproxima, hussainweb, vprocessor, hosef...

  • alexpott committed 5817330 on 8.2.x
    Issue #2409453 by quietone, phenaproxima, hussainweb, vprocessor, hosef...

Status: Fixed » Closed (fixed)

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