Problem/Motivation

Statistics module defines its own block type. The block settings used to be stored / managed by the module but then it was moved into the block. However migrate and the config schema was not updated. If you look for top_day_limit, top_recent_limit, top_all_limit, those are all only mentioned in config schema, default stats setting and migrations. Never used in code. Eg:

$ git grep "day_limit"
core/modules/migrate_drupal/config/install/migrate.migration.d6_statistics_settings.yml:  'block/popular/top_day_limit': statistics_block_top_day_num
core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php:    $this->assertIdentical($config->get('block.popular.top_day_limit'), 0);
core/modules/statistics/config/install/statistics.settings.yml:    top_day_limit: 0
core/modules/statistics/config/schema/statistics.schema.yml:            top_day_limit:

Proposed resolution

1. Remove the extra config schema from statistics module
2. Fix migrate to not migrate block settings to global stats setting (it already does the block setting migration proper from the same source data in BlockSettings.php)

Remaining tasks

Review. Commit.

User interface changes

None.

API changes

None except useless config schema elements removed.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because we have unnecessary schema that fails validation
Unfrozen changes Unfrozen because it removes unused schema without no other implication.
Prioritized changes The main goal of this issue is schema and Migrate code.

Comments

gábor hojtsy’s picture

gábor hojtsy’s picture

Status: Postponed » Needs review
Issue tags: +Configuration schema
StatusFileSize
new964 bytes

Actually we can produce a fail patch.

Also stats seem to be covered in the per block migration as well in BlockSettings.php:

      case 'statistics_popular_block':
        $settings['top_day_num'] = $old_settings['statistics']['statistics_block_top_day_num'];
        $settings['top_all_num'] = $old_settings['statistics']['statistics_block_top_all_num'];
        $settings['top_last_num'] = $old_settings['statistics']['statistics_block_top_last_num'];
        break;
gábor hojtsy’s picture

StatusFileSize
new3.45 KB
new2.51 KB

Actually this would be the whole thing.

The last submitted patch, 2: 2391403-stats-block.patch, failed testing.

gábor hojtsy’s picture

gábor hojtsy’s picture

Issue summary: View changes
penyaskito’s picture

Issue summary: View changes

BlockSettings is covering the migration and the clean-up looks good, RTBC.

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2391403-stats-block-3.patch, failed testing.

gábor hojtsy’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new3.52 KB

Rerolled. #2391245: Resolve remaining misc issues with configuration schema fails landed, which is where I found this bug in the first time.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed b388670 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation for to the issue summary.

  • alexpott committed b388670 on 8.0.x
    Issue #2391403 by Gábor Hojtsy: Statistics block not properly migrated,...

Status: Fixed » Closed (fixed)

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