admin/reports/upgrade route redirection fails under MigrateController class and throws illegal choice has been detected. Please contact the site administrator.

Created on 5 October 2023, about 1 year ago

Problem/Motivation

On traversing Reports > Upgrade Log, It opens a page with url admin/reports/dblog?type%5B0%5D=migrate_drupal_ui
with an error "Illegal choice has been detected. Please contact the site administrator. "

Steps to reproduce

1) Go to Reports > Upgrade Log
2) On opening the Upgrade Log it throws an error "Illegal choice has been detected. Please contact the site administrator. "

Proposed resolution

Under /core/modules/migrate_drupal_ui/src/Controller/MigrateController.php

  public function showLog(Request $request) {
    // Sets both the session and the query parameter so that it works correctly
    // with both the watchdog view and the fallback.
    $request->getSession()->set('dblog_overview_filter', ['type' => ['migrate_drupal_ui' => 'migrate_drupal_ui']]);
    return $this->redirect('dblog.overview', [], ['query' => ['type' => ['migrate_drupal_ui']]]);
  }

Here

    return $this->redirect('dblog.overview', [], ['query' => ['type' => ['migrate_drupal_ui']]]);

should be replaced with

    return $this->redirect('dblog.overview', [], ['query' => ['type' => 'migrate_drupal_ui']]);

so that currently the url which appears as type%5B0%5D=migrate_drupal_ui (where %5B0%5D is [0]) due to migrate_drupal_ui string added under array

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Migration 

Last updated about 16 hours ago

Created by

🇮🇳India hash6

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024