Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comments
Comment #2
arpitr CreditAttribution: arpitr commentedComment #3
arpitr CreditAttribution: arpitr commentedComment #4
arpitr CreditAttribution: arpitr commentedComment #6
jerdavisI 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.
Comment #7
akshay_dupdated with patch, please review
Comment #9
waverate CreditAttribution: waverate commentedCan you re-roll this patch against the lastest dev (22 Apr 2019)?
Comment #10
borisson_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.
Comment #11
waverate CreditAttribution: waverate commentedI was asking for a re-roll because I can’t apply the patch cleanly to even have this discussion.
Comment #12
legolasboThe 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.
Comment #13
legolasboThis 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.
Comment #15
legolasboThis 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.
Comment #16
legolasboThe blanket search and replace was a bit too greedy for #12. Let's try getting rid of the getMock deprecations again.
Comment #17
legolasboSo #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.xThat leaves the calls to drupal_set_message, which I will address in my next patch.
Comment #18
legolasboIt looks like the usages of drupal_set_message have already been removed. I did find a mock remaining, which this patch removes.
Comment #19
legolasboLol my bad, that remaining mock was part of another module. just ignore #18
Comment #20
waverate CreditAttribution: waverate commentedAgainst 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:
I believe ConfigurablePluginInterface still needs to be taken care of:
Comment #21
waverate CreditAttribution: waverate commentedComment #22
borisson_I don't think ConfigurablePluginInterface is something that we should do already now.
Comment #23
legolasboI 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.
Comment #25
borisson_Pushed #13 and #16
Comment #26
waverate CreditAttribution: waverate commentedAgainst facets-8.x-1.x-dev (15 May 2019): 9db3945404139d1f26f98629554a480351996c0d
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).Comment #27
waverate CreditAttribution: waverate commentedIs there a reason why tests/src/Unit/QueryType/QueryTypePluginManagerTest.php:
can't be replaced with:
Comment #28
Nikolay ShapovalovComment #29
legolasbo@waverate,
There isn't any reason for that other than it might have slipped through the cracks.
Comment #30
legolasboComment #31
Nikolay ShapovalovComment #32
borisson_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.