Problem/Motivation

drupal-check on version: 67ae9ec83de40c6021c6ae7a9542bce258ab0bf4

 ------ -------------------------------------------------
  Line   views_bulk_operations.drush.inc
 ------ -------------------------------------------------
  89     Call to deprecated function drush_get_option().
  93     Call to deprecated function drush_get_option().
  103    Call to deprecated function drush_get_option().
  112    Call to deprecated function drush_get_option().
  118    Call to deprecated function drush_get_option().
  174    Call to deprecated function drush_log().
  188    Call to deprecated function drush_log().
  198    Call to deprecated function drush_log().
  203    Call to deprecated function drush_print().
  204    Call to deprecated function drush_print().
  205    Call to deprecated function drush_print().
 ------ -------------------------------------------------
 
 [ERROR] Found 12 errors

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

josephdpurcell created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new27.46 KB

I changed deprecated methods, please review.

Status: Needs review » Needs work

The last submitted patch, 2: drupal_9_deprecated_code_report-3042613-2.patch, failed testing. View results

johnv’s picture

Will you not have backwards compatibility problems removing the precations already?
Or do you expect all installations tht update this module to have the latest drupal version?

sergiu stici’s picture

I expect the Drupal version to be larger than Drupal 8.5.x because at least Drupal\Core\TempStore\PrivateTempStoreFactory is included in the version >= 8.5.x

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new15.9 KB
new20.84 KB

By using the MessengerTrait we can avoid BC issues for people extending our classes.

Status: Needs review » Needs work

The last submitted patch, 6: 3042613-6.patch, failed testing. View results

graber’s picture

Status: Needs work » Postponed
Related issues: +#2975669: Replace usage of deprecated user.private_tempstore service

Thanks for this, we should start with PrivateTempStoreFactory as it already has its issue (linked).

graber’s picture

Status: Postponed » Needs work

No longer blocked.

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new15.77 KB

Rerrolled and fixed a few docblocks for:

-   * @var \Drupal\views_bulk_operations\ViewsbulkOperationsViewDataInterface - Not there anymore
+   * @var \Drupal\views_bulk_operations\Service\ViewsbulkOperationsViewDataInterface - Lives here now

Also previous patch docblocks were incorrect in couple of places:

-   * @var \Drupal\user\PrivateTempStoreFactory
+   * @var \Drupal\Core\TempStore\PrivateTempStoreFactory  // what we're actually using
manuel garcia’s picture

StatusFileSize
new721 bytes
new15.77 KB

Self-review, when using ViewsBulkOperationsFormTrait we should use $this->messenger().

joelpittet’s picture

Status: Needs review » Needs work
Issue tags: -midcamp2019 +Needs reroll, +Novice, +Seattle2019

Thanks @Manuel Garcia, looks like things got committed on this branch as it doesn't apply, probably the tempstore stuff. Tagging this to be rerolled.

Tagging for DrupalCon Seattle Friday contribution sprint.
See https://github.com/mglaman/drupal-check/wiki/Drupal-9-Readiness

Slack channel #d9readiness
https://drupal.slack.com/messages/CDDD98AMN

manuel garcia’s picture

Issue tags: -Needs reroll

I just tried applying #11 on 8.x-3.x after getting the latest changes, and it applies cleanly :)

manuel garcia’s picture

Status: Needs work » Needs review
bjenning’s picture

I'm just at drupalcon seattle and I tried running drupal-check on patch 11, and I got the following errors:

Line src/Action/ViewsBulkOperationsActionBase.php

16 Class Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase implements deprecated interface Drupal\Component\Plugin\ConfigurablePluginInterface.

Line src/Commands/ViewsBulkOperationsCommands.php
Class Drush\Commands\DrushCommands not found and could not be autoloaded.

jerdavis’s picture

Status: Needs review » Needs work
+++ b/modules/views_bulk_operations_example/src/Plugin/Action/ViewsBulkOperationExampleAction.php
@@ -2,6 +2,7 @@
+use Drupal\Core\Messenger\MessengerTrait;

@@ -22,6 +23,7 @@ use Drupal\Core\Session\AccountInterface;
+  use MessengerTrait;

+++ b/src/Plugin/Action/CancelUserAction.php
@@ -2,6 +2,7 @@
+use Drupal\Core\Messenger\MessengerTrait;

@@ -21,6 +22,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface;
+  use MessengerTrait;

These implementations are probably not be required. ViewsBulkOperationsActionBase extends ActionBase which extends PluginBase. PluginBase already implements MessengerTrait, so $this->messenger() should already be available.

+++ b/src/ViewsBulkOperationsBatch.php
@@ -22,10 +22,10 @@ class ViewsBulkOperationsBatch {
+    \Drupal::messenger()->addMessage($message, $type, $repeat);

I think we want this to use $this->messenger() rather than calling the service directly.

graber’s picture

Status: Needs work » Postponed
Related issues: +#2401797: Introduce a batch builder class to make the batch API easier to use
StatusFileSize
new14.63 KB
new1.76 KB

Ok, this will become a bit more tricky.
1. ConfigurablePluginInterface -> ConfigurableInterface: #3048199: Remove deprecated ConfigurablePluginInterface in favour of ConfigurableInterface
2. Class Drush\Commands\DrushCommands not found and could not be autoloaded: needs investigation
3. MessengerTrait in ViewsBulkOperationExampleAction and CancelUserAction: removed

@jerdavis, ViewsBulkOperationsBatch contains static methods, there is no $this available there.

Adding one more reference, the current array-based Batch API is not deprecated but may eventually be.

Setting this to postponed due to 3048199 but we can still commit the work already done if everything is fine with it. Starting from #11 There'll be a commit per patch that introduces something new, I'll also push a feature branch for this.

  • Graber committed 4ae530f on feature/3042613 authored by Manuel Garcia
    Issue #3042613 by Manuel Garcia, Sergiu Stici: Drupal 9 Deprecated Code...

  • Graber committed a7abb08 on feature/3042613
    Issue #3042613 by Manuel Garcia, Graber, Sergiu Stici: Drupal 9...

  • Graber committed 4ae530f on 8.x-3.x authored by Manuel Garcia
    Issue #3042613 by Manuel Garcia, Sergiu Stici: Drupal 9 Deprecated Code...
  • Graber committed a7abb08 on 8.x-3.x
    Issue #3042613 by Manuel Garcia, Graber, Sergiu Stici: Drupal 9...
eelkeblok’s picture

I think 2 boils down to the particular Drush version Drupal-check can find. I have Drush 10 installed in my setup and instead of complaining about a class it can not find, it says:

------ ------------------------------------------ 
  Line   views_bulk_operations.drush.inc           
 ------ ------------------------------------------ 
  174    Call to deprecated function drush_log().  
  188    Call to deprecated function drush_log().  
  198    Call to deprecated function drush_log().  
 ------ ------------------------------------------ 

I expect these to be marked as deprecated because they are in Drush 10.

eelkeblok’s picture

Status: Postponed » Needs work

As #3048199: Remove deprecated ConfigurablePluginInterface in favour of ConfigurableInterface is no longer postponed, I guess we can un-postpone this too.

I guess for this the core_version_requirement key will also need to be added, and the core version requirements should also be reflected in composer.json. However, I wonder if that should happen in 4.0, if it's decided that is to happen (see #3048199: Remove deprecated ConfigurablePluginInterface in favour of ConfigurableInterface).

eelkeblok’s picture

Adding one more reference, the current array-based Batch API is not deprecated but may eventually be.

Looks like that issue (#2401797: Introduce a batch builder class to make the batch API easier to use only produced a different way of building the array that will be ultimately fed to batch_set(). Doesn't seem relevant all that much.

maximpodorov’s picture

global $pager_page_array, $pager_total, $pager_total_items are deprecated and should be replaced by PageManager service methods.

graber’s picture

Re #24, we have that handled in #3056119: Save current data of a pager now.

graber’s picture

Status: Needs work » Postponed (maintainer needs more info)

Can someone re-check on the latest dev and update the issue description?

jkswoods’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs work

@Graber issue summary updated.

graber’s picture

Not bad, thanks :)

manuel garcia’s picture

Status: Needs work » Needs review
StatusFileSize
new1.33 KB

Thanks @jkswoods for updating the issue summary.

The deprecations on views_bulk_operations.drush.inc are because this is the legacy Drush 8 commands. I think they've already been migrated to Drush 9 (see ViewsBulkOperationsCommands) so its up to the maintainers to decide when to drop support for Drush 8. Looking at this https://docs.drush.org/en/master/install/#drupal-compatibility one could make an argument that any time would in theory be ok.

For the time being I have handled the deprecation on ViewsBulkOperationsActionBase here (see https://www.drupal.org/node/2946161)

  • Graber committed 3d85052 on 8.x-3.x authored by Manuel Garcia
    Issue #3042613 by Manuel Garcia, Graber, Sergiu Stici: Removed...
  • Graber committed 4ee1e91 on 8.x-3.x
    Issue #3042613 by Manuel Garcia, Graber, Sergiu Stici: Drupal 9...
jkswoods’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

As per #29, I think this is good to move in to RTBC.

graber’s picture

Yes, this is actually fixed for now but there may be more deprecations in the future. We may leave it as RTBC so it doesn't dissapear from the issue queue with default filtering.

graber’s picture

Status: Reviewed & tested by the community » Fixed

Drupal 9 is in beta now so no new issues expected. Setting to fixed.

Status: Fixed » Closed (fixed)

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

edycarreyes99’s picture

StatusFileSize
new2.8 KB
new2.8 KB

fixed 'patch is not applicable', fix drush_log() deprecated code, updated 'drupal/core: ^9' in composer.json file, and added core_version_requirement: ^8 || ^9 for D9 supports.

johnv’s picture

@edycarreyes99, patch #13 is already committed, as per #30. So please check with latest -dev version.
Also 'closed' tickets are not supposed to be re-opened again.