Problem/Motivation

Cloned this issue: https://www.drupal.org/project/views_bulk_operations/issues/3065159
and created a merge request.

Would like the ability to override the finished message for the batch, and also disable it in certain cases.

Steps to reproduce

Creating a custom VBO plugin and after execution finishes a default message of "Action processing results:" displays which in some cases is not desired.

Proposed resolution

You can override the message in your action by overriding the `finished` method defined in ViewsBulkOperationsActionCompletedTrait that is a part of ViewsBulkOperationsActionBase
This method is used as the batch finished callback, so it brings a bit more possibilities than message override only :)

Remaining tasks

Need review, and also confirmation.

User interface changes

None.

API changes

Adds the ability to override finished messaging by implementing the ViewsBulkOperationsMessageInterface

Data model changes

CommentFileSizeAuthor
#9 Screenshot 2021-05-21 at 14.01.10.png78.53 KBgraber
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Bits8myBytes created an issue. See original summary.

Bits8myBytes’s picture

Issue summary: View changes
graber’s picture

Status: Active » Needs work

A few things:

  • The message could also support the details placeholder.
  • It'd be nice to have a kernel test for this so we also have an implementation example.
Bits8myBytes’s picture

Thanks for such a fast response, I actually looked more into it and although what I originally did worked for me it was not ideal. I refactored the approach, added unit testing to the new message override logic, added option for drush message override, and added a sample test plugin with Kernel test.

Bits8myBytes’s picture

Issue summary: View changes
Bits8myBytes’s picture

Issue summary: View changes
scott.whittaker’s picture

Sorry, is there a way to get these merge requests in patch form for adding to a composer.json or are they not meant to be tested until complete?

graber’s picture

StatusFileSize
new78.53 KB

@scott
help

graber’s picture

Hmm, I see I'm not getting notified on issue updates that happen in merge requests.. sorry @Bits8myBytes, I'll check this out again sometime soon.

graber’s picture

Issue summary: View changes
graber’s picture

Status: Needs work » Needs review
graber’s picture

Also, apologies @Bits8myBytes for taking over like this.. I thought it'd be a good way to spend half of my Saturday for once and didn't want this to get out of hand. I hope it works fine outside of my testing scope as well.

graber’s picture

Title: Allow a message override for the batch finished method. » Allow to override the batch finished method.
graber’s picture

Issue tags: +Needs documentation

This'll also need to be included in the docs.

  • Graber committed 5324dfb on 8.x-3.x
    Issue #3207304 by Bits8myBytes, Graber: Allow to override the batch...
graber’s picture

Status: Needs review » Fixed

  • Graber committed 56c9d11 on 4.0.x
    Issue #3207304 by Bits8myBytes, Graber: Allow to override the batch...

Status: Fixed » Closed (fixed)

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