Problem/Motivation

When re-indexing is executed through the CLI using the new drush command there is no output to stdout. At present the messenger service is used as the re-indexing was initially built in the context of the UI.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mortim07 created an issue. See original summary.

mortim07’s picture

StatusFileSize
new3.12 KB
nterbogt’s picture

Can we consider extending this to have both messenger and logger?

I think we need messenger for user feedback, but regardless of whether the user did it via UI or CLI, we should probably be able to see that in the logs.

mortim07’s picture

StatusFileSize
new2.96 KB

@nterbogt I've removed the 'if' statement in the log method. It now just runs both.

mortim07’s picture

StatusFileSize
new4.09 KB
mortim07’s picture

Status: Active » Needs review
mortim07’s picture

StatusFileSize
new4.09 KB

@jibran I've combined your patch into mine - https://www.drupal.org/project/data_pipelines/issues/3258509

jibran’s picture

I think we are missing

+++ b/src/Form/DatasetBatchOperations.php
@@ -146,11 +146,11 @@ class DatasetBatchOperations implements ContainerInjectionInterface {
-      $context['message'] = new TranslatableMarkup('Validation complete, validation errors exist');
+      $context['message'] = new TranslatableMarkup('Validation complete, validation errors exist for dataset (@dataset).', ['@dataset' => $dataset->label()]);

+++ b/tests/src/Kernel/Form/DatasetBatchOperationsTest.php
@@ -52,7 +52,7 @@ CSV;
-    $this->assertEquals('Validation complete, validation errors exist', (string) $context['message']);
+    $this->assertEquals('Validation complete, validation errors exist for dataset (' . $dataset->label() . ').', (string) $context['message']);

from #3258509: Make the validation failure more helpful.

mortim07’s picture

StatusFileSize
new4.19 KB
jibran’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks good to me. Thanks for the changes.

  • mortim07 committed 742f431 on 1.x
    Issue #3259249 by mortim07: Ensure output for re-indexing goes to stdout...
mortim07’s picture

Status: Reviewed & tested by the community » Fixed
mortim07’s picture

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.