Problem/Motivation

In some cases it would be beneficial to act on entities that are about to be imported.

Steps to reproduce

N/A

Proposed resolution

Add the module handler to the importer service and invoke hook_default_content_import.

Remaining tasks

  • Add default_content.api.php file describing the additional hook.
  • Add tests.

User interface changes

None.

API changes

Adds a hook_default_content_import() which other extensions may implement to act on the entity import.

Data model changes

None.

Comments

kerasai created an issue. See original summary.

kerasai’s picture

Status: Active » Needs review
StatusFileSize
new384 bytes

This path invokes hook_default_content_import just prior to importing the entity.

Phil Wolstenholme’s picture

I think in the past the module has used events rather than hooks, there's an open issue for adding events to the 2.0 release: https://www.drupal.org/project/default_content/issues/2837719

kerasai’s picture

StatusFileSize
new374 bytes

Updated version of the patch, applies to 2.0.0-alpha3 .

kmajzlik’s picture

Hooks are back as good developer way with D11.1