Quantcast
Viewing all articles
Browse latest Browse all 295818

Impossible to enable source count caching for all SqlBase-based source plugins (i.e. most of them)

Problem/Motivation

This flaw was introduced in #2125717: Migrate in core: patch #1 and also not fixed in #2427335: Combine legacy Source class into SourcePluginBase.

\Drupal\migrate\Plugin\migrate\source\SourcePluginBase::count() has the infrastructure to enable caching of source counts.

But since \Drupal\migrate\Plugin\migrate\source\SqlBase::count() overrides \Drupal\migrate\Plugin\migrate\source\SourcePluginBase::count(), none of that infrastructure can be used by SqlBase-based @MigrateSource plugins.

Worse: the vast majority of @MigrateSource plugins are subclasses of SqlBase, meaning it the vast majority of @MigrateSource plugins cannot be made cacheable.

(To make a migration have a cacheable source count, all you need to do is specify cache_counts: true under the migration definition's source key. And until #2751829: Default source plugin cache key is insufficiently unique is fixed, you'll also need to specify cache_key.)

To make these cacheable today, you'd have to patch them.

This would unblock:

    in core: #3190818: [PP-1] Allow source counts to be cached: implement ::doCount() instead of ::count()
  1. in contrib: metatag: #3190804: [PP-1] Allow source counts to be cached: implement ::doCount() instead of ::count()
  2. in contrib: media_migration: #3190800: [PP-1] Allow source counts to be cached: implement ::doCount() instead of ::count()

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 295818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>