Incomplete examples in API docs for the download process plugin

Created on 23 September 2023, over 1 year ago
Updated 26 September 2023, over 1 year ago

Problem/Motivation

The doc block in core/modules/migrate/src/Plugin/migrate/process/Download.php include two examples like this:

 * process:
 *   plugin: download
 *   source:
 *     - source_url
 *     - destination_uri

The process: key should have a field name underneath it, and the rest of the YAML should be underneath that field.

Steps to reproduce

Review the API docs for the Download class.

Proposed resolution

Add a field to the first example, similar to the example in the file_copy plugin:

 * process:
 *   path_to_file:
 *     plugin: download
 *     source:
 *       - source_url
 *       - destination_uri

Model the second example on d7_file, using the plugin to set uri in a migration that creates file entities:

 * @code
 * process:
 *   uri:
 *     plugin: download
 *     source:
 *       - source_url
 *       - destination_uri
 *     file_exists: rename
 *   # other fields ...
 * destination:
 *   plugin: entity:file
 * @endcode
 *
 * This will download source_url to destination_uri and ensure that the
 * destination URI is unique. If a file with the same name exists at the
 * destination, a numbered suffix like '_0' will be appended to make it unique.
 * The destination uri is saved in a file entity.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/A

πŸ› Bug report
Status

Fixed

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024