/admin/content/migrate_source_ui leads to /core/install.php

Created on 17 November 2023, over 1 year ago

Problem/Motivation

I installed the module, but I can not access /admin/content/migrate_source_ui - I'm directly redirected to /core/install.php

- Drupal 9.5.11

Steps to reproduce

* Install the Plugin
* Try to access /admin/content/migrate_source_ui

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Schoenef Unna

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

Comments & Activities

  • Issue created by @Schoenef
  • πŸ‡©πŸ‡ͺGermany Schoenef Unna

    /admin/config/content/migrate_source_ui works, I'm double checking if there is some kind of redirect.

  • πŸ‡©πŸ‡ͺGermany Schoenef Unna

    Ok, so it is a code issue, possibly related to https://www.drupal.org/project/drupal/issues/2974321 β†’

    - The form is called, but the redirect happens during the buildForm method in this loop:

    foreach ($this->definitions as $definition) {
          $migrationInstance = $this->pluginManagerMigration->createStubMigration($definition);
          if ($migrationInstance->getSourcePlugin() instanceof CSV || $migrationInstance->getSourcePlugin() instanceof Json || $migrationInstance->getSourcePlugin() instanceof Xml) {
            $id = $definition['id'];
            $options[$id] = $this->t('%id (supports %file_type)', [
              '%id' => $definition['label'] ?? $id,
              '%file_type' => $this->getFileExtensionSupported($migrationInstance),
            ]);
          }
        }
    
  • πŸ‡©πŸ‡ͺGermany Schoenef Unna

    The second of our 6 migrations is already bringing it down - the used plugin is `custom_sql_query` - I guess $this->pluginManagerMigration->createStubMigration($definition) is doing something very ressource intentsive under the hood for this.

    I propose do delay this call as late as possible.

  • πŸ‡©πŸ‡ͺGermany Schoenef Unna

    This patch works for me - a little drawback is, that I had to hardcode the plugin id, but it takes too much time now, to introduce a static getId method to the migrate universe.

  • Status changed to Postponed: needs info about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    @schoenef:

    Thanks for reporting this issue and for proposing a patch.

    A bug report should have reliable "steps to reproduce" (STR). Yours are incomplete: when I install Drupal and this module, I do not see the bug you report. Comment #4 suggests that the bug is related to a particular migration, and perhaps to a custom source plugin. Can you give enough information (in the issue summary STR) so that we can reproduce the bug?

    When you propose a solution by attaching a patch or opening a merge request (MR), remember to change the status from Active to Needs Review so that the maintainers and others know to look at it.

    ... a little drawback is, that I had to hardcode the plugin id ...

    I guess you mean this line?

          if ( in_array($definition['source']['plugin'] ?? 'none', ['csv', 'json', 'xml'])) {
    

    That is a problem. If MyCsv is a source plugin that extends the CSV plugin, then the original condition $migrationInstance->getSourcePlugin() instanceof CSV holds, but you have replaced it with a condition that will fail.

    I am not sure of the correct status: Needs Work because of the problem with the suggested fix or "needs more info" because of the STR. I think the STR problem is more important.

Production build 0.71.5 2024