Problem/Motivation

drupal-check results on commit hash: ece1a1ca46335dbc3d1fb6631f4b036039d1adbc


 ------ ------------------------------------------------------- 
  Line   modules/facets_summary/src/Form/FacetsSummaryForm.php  
 ------ ------------------------------------------------------- 
  403    Call to deprecated function drupal_set_message().      
 ------ ------------------------------------------------------- 

 ------ --------------------------------------------------------------- 
  Line   modules/facets_summary/src/Form/FacetsSummarySettingsForm.php  
 ------ --------------------------------------------------------------- 
  197    Call to deprecated function drupal_set_message().              
  225    Call to deprecated function drupal_set_message().              
  244    Call to deprecated function drupal_set_message().              
 ------ --------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------- 
  Line   modules/facets_summary/tests/src/Functional/HierarchicalFacetIntegrationTest.php  
 ------ ---------------------------------------------------------------------------------- 
  20     Usage of deprecated trait                                                         
         Drupal\field\Tests\EntityReference\EntityReferenceTestTrait in class              
         Drupal\Tests\facets_summary\Functional\HierarchicalFacetIntegrationTest.          
 ------ ---------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------- 
  Line   modules/facets_summary/tests/src/Functional/IntegrationTest.php                
 ------ ------------------------------------------------------------------------------- 
  211    Call to deprecated method assertText() of class Drupal\Tests\BrowserTestBase.  
 ------ ------------------------------------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/FacetListBuilder.php                           
 ------ --------------------------------------------------- 
  303    Call to deprecated function drupal_set_message().  
  331    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/FacetCloneForm.php                        
 ------ --------------------------------------------------- 
  74     Call to deprecated function drupal_set_message().  
  153    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/FacetDeleteConfirmForm.php                
 ------ --------------------------------------------------- 
  40     Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/FacetForm.php                             
 ------ --------------------------------------------------- 
  720    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/FacetSettingsForm.php                     
 ------ --------------------------------------------------- 
  292    Call to deprecated function drupal_set_message().  
  297    Call to deprecated function drupal_set_message().  
  315    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   src/Form/FacetSourceEditForm.php                   
 ------ --------------------------------------------------- 
  180    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/facets_custom_widget/src/Plugin/facets/processor/TestPreQuery.php  
 ------ ------------------------------------------------------------------------- 
  46     Call to deprecated function drupal_set_message().                        
 ------ ------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------- 
  Line   tests/src/Functional/HierarchicalFacetIntegrationTest.php             
 ------ ---------------------------------------------------------------------- 
  19     Usage of deprecated trait                                             
         Drupal\field\Tests\EntityReference\EntityReferenceTestTrait in class  
         Drupal\Tests\facets\Functional\HierarchicalFacetIntegrationTest.      
 ------ ---------------------------------------------------------------------- 

 ------ ----------------------------------------------------------- 
  Line   tests/src/Functional/ProcessorIntegrationTest.php          
 ------ ----------------------------------------------------------- 
  88     Call to deprecated method assertOptionSelected() of class  
         Drupal\Tests\BrowserTestBase.                              
  89     Call to deprecated method assertOptionSelected() of class  
         Drupal\Tests\BrowserTestBase.                              
  101    Call to deprecated method assertOptionSelected() of class  
         Drupal\Tests\BrowserTestBase.                              
  102    Call to deprecated method assertOptionSelected() of class  
         Drupal\Tests\BrowserTestBase.                              
 ------ ----------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------- 
  Line   tests/src/Functional/TestHelperTrait.php (in context of class Drupal\Tests\facets\Functional\FacetsTestBase)  
 ------ -------------------------------------------------------------------------------------------------------------- 
  22     Call to deprecated method assert() of class Drupal\Tests\BrowserTestBase.                                     
  39     Call to deprecated method assert() of class Drupal\Tests\BrowserTestBase.                                     
  58     Call to deprecated method assert() of class Drupal\Tests\BrowserTestBase.                                     
 ------ -------------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/FacetSource/FacetSourcePluginManagerTest.php              
 ------ ------------------------------------------------------------------------- 
  60     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  66     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  68     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/processor/ListItemProcessorTest.php                
 ------ ------------------------------------------------------------------------- 
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/processor/TranslateEntityProcessorTest.php         
 ------ ------------------------------------------------------------------------- 
  62     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  66     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  73     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  133    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  176    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  211    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php   
 ------ ------------------------------------------------------------------------- 
  42     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  43     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  43     Fetching class constant class of deprecated class                        
         Drupal\Core\Entity\EntityManagerInterface.                               
  44     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  52     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  93     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  94     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  94     Fetching class constant class of deprecated class                        
         Drupal\Core\Entity\EntityManagerInterface.                               
  95     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/processor/UrlProcessorHandlerTest.php              
 ------ ------------------------------------------------------------------------- 
  110    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Plugin/url_processor/QueryStringTest.php                  
 ------ ------------------------------------------------------------------------- 
  89     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  126    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  207    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  273    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  372    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  395    Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Processor/ProcessorPluginManagerTest.php                  
 ------ ------------------------------------------------------------------------- 
  68     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  74     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  76     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  78     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/QueryType/QueryTypePluginManagerTest.php                  
 ------ ------------------------------------------------------------------------- 
  59     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  65     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/UrlProcessor/UrlProcessorPluginManagerTest.php            
 ------ ------------------------------------------------------------------------- 
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  73     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  75     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  77     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Utility/FacetsDateHandlerTest.php                         
 ------ ------------------------------------------------------------------------- 
  46     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  48     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  48     Fetching class constant class of deprecated class                        
         Drupal\Core\Entity\EntityManagerInterface.                               
  56     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  59     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  60     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/Widget/WidgetPluginManagerTest.php                        
 ------ ------------------------------------------------------------------------- 
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  73     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  75     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  77     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 [ERROR] Found 72 errors                                                                  

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcdwayne created an issue. See original summary.

arpitr’s picture

Assigned: Unassigned » arpitr
Issue tags: +Seattle2019
arpitr’s picture

arpitr’s picture

Assigned: arpitr » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: drupal-9-readiness-3042654-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jerdavis’s picture

+++ b/modules/facets_summary/src/Form/FacetsSummaryForm.php
@@ -11,11 +11,14 @@ use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Messenger\MessengerInterface;
+use Drupal\Core\Messenger\MessengerTrait;
...
+  use MessengerTrait;

I don't believe this is required. These classes extend EntityForm, which in turn extends FormBase. FormBase is already adding the MessengerTrait and $this->messenger() should already be present.

akshay_d’s picture

Status: Needs work » Needs review
FileSize
61.99 KB

updated with patch, please review

Status: Needs review » Needs work

The last submitted patch, 7: removed_deprecation_3042654-7.patch, failed testing. View results

waverate’s picture

Can you re-roll this patch against the lastest dev (22 Apr 2019)?

borisson_’s picture

Just rerolling this will not be enough. The broken tests should also be fixed. Not sure if these are failing because of code issues or because of test issues.

waverate’s picture

I was asking for a re-roll because I can’t apply the patch cleanly to even have this discussion.

legolasbo’s picture

Status: Needs work » Needs review
FileSize
29.98 KB

The patch in #7 is huge and addresses multiple issues at the same time, making it hard to review and fix. Let's take this one step at a time and start with the most abundant and simple deprecation first.

legolasbo’s picture

This patch replaces the EntityReferenceTestTrait, which was deprecated in Drupal 8.6. I therefore expect the tests for 8.5 to fail, but that should not matter because this is only used in testing, which isn't done in production.

The last submitted patch, 12: replace-deprecated-getMock-3042654-12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

legolasbo’s picture

This patch removes the usage of entity_manager, which I fully expect to conflict with #12, but let's see what testbot thinks about this change in isolation.

legolasbo’s picture

The blanket search and replace was a bit too greedy for #12. Let's try getting rid of the getMock deprecations again.

legolasbo’s picture

So #13 and #16 should be safe to commit because both of them only affect test code and are still passing the tests.

It looks like we can't use #13 to fully remove the entity manager service just yet because it is still being used in Drupal 8.6 and I assume we still want to support all supported Core versions.

My local execution of drupal-check also reported 2 deprecated usages of Drupal\Component\Plugin\ConfigurablePluginInterface which was only deprecated in 8.7, so we'll have to wait with fixing that until 8.7 is the minimal supported version of Drupal 8 or until we start work on 8.x-2.x

That leaves the calls to drupal_set_message, which I will address in my next patch.

legolasbo’s picture

It looks like the usages of drupal_set_message have already been removed. I did find a mock remaining, which this patch removes.

legolasbo’s picture

Lol my bad, that remaining mock was part of another module. just ignore #18

waverate’s picture

Against facets-8.x-1.x-dev (13 May 2019): 653d1654dcc98fea0044e2b6174969bac57302ca

Patch at #13 removed EntityReferenceTestTrait errors.

Patch at #15 removed EntityManagerInterface errors.

Patch at #16 left the following getMock errors:

  Line   tests/src/Unit/QueryType/QueryTypePluginManagerTest.php                  
 ------ ------------------------------------------------------------------------- 
  65     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

I believe ConfigurablePluginInterface still needs to be taken care of:

 ------ ---------------------------------------------------------------------- 
  Line   modules/facets_summary/src/Processor/ProcessorInterface.php           
 ------ ---------------------------------------------------------------------- 
  13     Interface Drupal\facets_summary\Processor\ProcessorInterface extends  
         deprecated interface                                                  
         Drupal\Component\Plugin\ConfigurablePluginInterface.                  
 ------ ---------------------------------------------------------------------- 
waverate’s picture

Status: Needs review » Needs work
borisson_’s picture

I don't think ConfigurablePluginInterface is something that we should do already now.

legolasbo’s picture

I agree with borisson_'s comment in #22. We shouldn't break compatibility with supported Drupal versions unless there is a very good reason to do so.

  • legolasbo authored 54832c2 on 8.x-1.x
    Issue #3042654 by legolasbo, arpitr, akshay_d, borisson_: Drupal 9...
  • legolasbo authored 9db3945 on 8.x-1.x
    Issue #3042654 by legolasbo, arpitr, akshay_d, borisson_: Drupal 9...
borisson_’s picture

Pushed #13 and #16

waverate’s picture

Against facets-8.x-1.x-dev (15 May 2019): 9db3945404139d1f26f98629554a480351996c0d

 ------ ---------------------------------------------------------------------- 
  Line   modules/facets_summary/src/Processor/ProcessorInterface.php           
 ------ ---------------------------------------------------------------------- 
  13     Interface Drupal\facets_summary\Processor\ProcessorInterface extends  
         deprecated interface                                                  
         Drupal\Component\Plugin\ConfigurablePluginInterface.                  
 ------ ---------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   src/Processor/ProcessorInterface.php                                     
 ------ ------------------------------------------------------------------------- 
  13     Interface Drupal\facets\Processor\ProcessorInterface extends deprecated  
         interface Drupal\Component\Plugin\ConfigurablePluginInterface.           
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   src/QueryType/QueryTypePluginBase.php                                    
 ------ ------------------------------------------------------------------------- 
  12     Class Drupal\facets\QueryType\QueryTypePluginBase implements deprecated  
         interface Drupal\Component\Plugin\ConfigurablePluginInterface.           
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------- 
  Line   src/Widget/WidgetPluginInterface.php                                     
 ------ ------------------------------------------------------------------------- 
  12     Interface Drupal\facets\Widget\WidgetPluginInterface extends deprecated  
         interface Drupal\Component\Plugin\ConfigurablePluginInterface.           
 ------ ------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------ 
  Line   tests/src/Unit/Plugin/processor/UidToUserNameCallbackProcessorTest.php  
 ------ ------------------------------------------------------------------------ 
  43     Fetching class constant class of deprecated class                       
         Drupal\Core\Entity\EntityManagerInterface.                              
  94     Fetching class constant class of deprecated class                       
         Drupal\Core\Entity\EntityManagerInterface.                              
 ------ ------------------------------------------------------------------------ 

 ------ ------------------------------------------------------------------------- 
  Line   tests/src/Unit/QueryType/QueryTypePluginManagerTest.php                  
 ------ ------------------------------------------------------------------------- 
  65     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
  67     Call to deprecated method getMock() of class Drupal\Tests\UnitTestCase.  
 ------ ------------------------------------------------------------------------- 

 ------ --------------------------------------------------- 
  Line   tests/src/Unit/Utility/FacetsDateHandlerTest.php   
 ------ --------------------------------------------------- 
  48     Fetching class constant class of deprecated class  
         Drupal\Core\Entity\EntityManagerInterface.         
 ------ --------------------------------------------------- 

                                                                                
 [ERROR] Found 9 errors                                                         
                                                                                

To summarize:

1. Drupal\Component\Plugin\ConfigurablePluginInterface remains as discussed in #17 (8.7 depreciation).

2. Drupal\Core\Entity\EntityManagerInterface remains as discussed in #17 (8.6 depreciation).

waverate’s picture

Is there a reason why tests/src/Unit/QueryType/QueryTypePluginManagerTest.php:

    $this->moduleHandler = $this->getMock(ModuleHandlerInterface::class);

    $this->cache = $this->getMock(CacheBackendInterface::class);

can't be replaced with:

    $this->moduleHandler = $this->createMock(ModuleHandlerInterface::class);

    $this->cache = $this->createMock(CacheBackendInterface::class);
Nikolay Shapovalov’s picture

Assigned: Unassigned » Nikolay Shapovalov
Issue tags: +DrupalCampBelarus2019
legolasbo’s picture

@waverate,

There isn't any reason for that other than it might have slipped through the cracks.

legolasbo’s picture

Nikolay Shapovalov’s picture

Assigned: Nikolay Shapovalov » Unassigned
borisson_’s picture

Status: Needs work » Fixed

Closing this as fixed. We have another open issue for the remaining this - those will be worked on when we no longer support 8.6.

Status: Fixed » Closed (fixed)

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