Problem/Motivation

The Importer service is coupled to only import from modules.
This is problematic because if we would like to build a user interface that imports from a uploaded .zip we cannot do that without creating a new Importer service (which would literally just be a huge code duplicate).

Proposed resolution

Change Importer::importContent to accept a path instead of a module, alternatively:
Add a new method allowing to import content from a given path.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

johndevman created an issue. See original summary.

larowlan’s picture

I'm in support of this feature, and would welcome patches.

ciss’s picture

Should this change be made transparently, without breaking the existing API?

ciss’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
kevinfunk’s picture

StatusFileSize
new1.8 KB

Importer::importContent now has a parameter of folder instead of module.

kevinfunk’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: decouple-importer-2951076-5.patch, failed testing. View results

berdir’s picture

$module is still used in the event and tests would need to be updated too.

duncancm’s picture

StatusFileSize
new1.48 KB

Incremental improvements. Importer::importContent accepts a generic $source which could be a module name or folder path. Also bypass the event dispatchers if importing from a folder source.

duncancm’s picture

StatusFileSize
new1.48 KB

Fixed patch comment id.

duncancm’s picture

StatusFileSize
new1.48 KB

Actually fixed patch comment id.

kevinfunk’s picture

StatusFileSize
new1.89 KB

Thanks @duncancm. I think using $source is a better idea. I was getting errors with #11 so I updated the event dispatchers to use $source.

kevinfunk’s picture

Status: Needs work » Needs review
StatusFileSize
new1.95 KB

Re-roll

Status: Needs review » Needs work

The last submitted patch, 13: default_content-decouple-importer-2951076-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

chesn0k made their first commit to this issue’s fork.