progressMessage returns empty [notice]

Created on 6 December 2023, 12 months ago

Problem/Motivation

I have a really weird problem.

I have added a new custom migration called "csd_import" and when I run the migration import with drush mim csd_import, then the the notice progressMessage() method returns an empty notice like so

[notice]

instead of someting like this

[notice] Processed 2 items (0 created, 2 updated, 0 failed, 0 ignored) - done with 'csd_import'

Analysed problem

I have found out, that there is the single quotes (') surrounding the @name cause a problem within this code block:

    if ($done) {
      $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'";
      $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with '@name'";
    }
    else {
      $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'";
      $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with '@name'";
    }

once I remove all single quotes as you can see in the following code block, it works.

    if ($done) {
      $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - done with @name";
      $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - done with @name";
    }
    else {
      $singular_message = "Processed 1 item (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with @name";
      $plural_message = "Processed @numitems items (@created created, @updated updated, @failures failed, @ignored ignored) - continuing with @name";
    }

I have absolutely no idea what causes this problem.

Has anyody ever had that problem?

I am using:

  • Drupal 10.0.11
  • PHP 8.1.18
  • Drush 11.6.0
🐛 Bug report
Status

Active

Version

6.0

Component

Code

Created by

🇨🇭Switzerland martinpe

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

Comments & Activities

Production build 0.71.5 2024