Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292913

MigrateUpgradeImportBatch does not use source_private_file_path & source_base_path correctly, making it impossible to have public & private files in separate locations

$
0
0

Problem/Motivation

I am trying to migrate drupal 7.56 to 8.4.2 using migrate_drupal and migrate_drupal_ui web interface.
The instructions for file path seems to be misleading.

It is asking to enter "Public file directory" and "Private file directory". The variables seems to be interchanged i.e., the Public_file_path value is being used for importing private files. with this, Private files are getting imported.
Public file path is becoming "private_file_path/sites/default/files..." and public file import is being failed.

If both the values are entered, i.e., public_file_directory for public and private_file_directory for private, the values are becoming "file://public_file_path///private_file_path".

Proposed resolution

Change the ReviewForm so that both the source_base_path and the source_private_path are added to the batch configuration.

Then in MigrateUpgradeImportBatch, for all file migrations, set the source_base_path constant of the source plugin. Use the scheme property of the source plugin, $definition['source']['scheme'], to select the public or private base path entered by the user on the CredentialForm.

Add a new functional test, FilePathTest, to confirm the proposed resolution truly works.

Remaining tasks

  • Change record
  • Release notes snippet

User interface changes

N/A

API changes

Data model changes

Release notes snippet

When Drupal 7-to-Drupal migrations are run through the user interface, the 'Private file directory' is now used correctly as the base source path for the private files.


Viewing all articles
Browse latest Browse all 292913

Trending Articles



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