By drunken monkey on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x-1.x
Introduced in version:
8.x-1.40
Issue links:
Description:
In contrast to all other plugin types that are provided by the Search API module, trackers did not have a useful base class to inherit from: TrackerPluginBase was completely empty, while the default Basic tracker plugin had a complete implementation of a DB-based tracking system.
This was now flipped completely: The entire class body of the \Drupal\search_api\Plugin\search_api\tracker\Basic class was moved to \Drupal\search_api\Tracker\TrackerPluginBase, which now provides a complete implementation of a DB-based tracker by default.
This change only affects custom tracker plugin implementations:
- In case the tracker plugin previously inherited from
Basicto provide a DB-based tracker with slightly different internals, it can now inherit fromTrackerPluginBaseas soon as the code depends on a version of the Search API that includes this change. If both older and newer versions of the Search API need to be supported, the plugin class can keep inheriting fromBasic. - In case the tracker plugin previously inherited from
TrackerPluginBaseto provide a tracker implementation that does not use the database, or is too dissimilar to theBasicplugin for inheritance from it to make sense, the plugin should now inherit from\Drupal\search_api\Plugin\IndexPluginBaseinstead and manually implement\Drupal\search_api\Tracker\TrackerInterface. (See\Drupal\search_api_test\Plugin\search_api\tracker\TestTrackerfor an example.)
Impacts:
Module developers