Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DrushBatchContext magic wrapper for batch . #5353

Closed
wants to merge 1 commit into from
Closed

Remove DrushBatchContext magic wrapper for batch . #5353

wants to merge 1 commit into from

Conversation

halison-imagex
Copy link
Contributor

It should fix this issue #5009

Tests are passing.

Summary:
The DrushBatchContext wrapper is causing issues to keep the batch $context values. It's mainly used for logging, but it can be done in the operations level instead of overriding the $context type.
The variable $context['error_message'] is only being used by the drush batch processes and we can use Drush::logger()->error(); as a replacement.
After this change, we can use the $task_message variable to retrieve the $context['message'] value and log it to the user.

I tested the updb in one of my sites and this is the output:

 ----------------------- ------------------------------- --------------- ------------------------------------------------------------------------------ 
  Module                  Update ID                       Type            Description                                                                   
 ----------------------- ------------------------------- --------------- ------------------------------------------------------------------------------ 
  lightning_media_image   9001                            hook_update_n   9001 - Downloads the Cropper JavaScript library if needed.                    
  block_content           entity_changed_constraint       post-update     Clear the entity type cache.                                                  
  ctools                  remove_entitybundleconstraint   post-update     Invalidate the service container to force EntityBundleConstriant is Removed.  
  webform                 ckeditor                        post-update     Move from custom CKEditor to hidden 'webform_default' text format.            
 ----------------------- ------------------------------- --------------- ------------------------------------------------------------------------------ 


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > 

>  [notice] Update started: lightning_media_image_update_9001
>  [notice] Update completed: lightning_media_image_update_9001
>  [notice] Update started: block_content_post_update_entity_changed_constraint
>  [notice] Update completed: block_content_post_update_entity_changed_constraint
>  [notice] Update started: ctools_post_update_remove_entitybundleconstraint
>  [notice] Update completed: ctools_post_update_remove_entitybundleconstraint
>  [notice] Update started: webform_post_update_ckeditor
>  [notice] Update completed: webform_post_update_ckeditor
 [success] Finished performing updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant