To date (End of February 2019), the acquia_connector module is using lots of deprecated APIs. To be ready for Drupal 9, it'd be great to remove them ASAP.

------ --------------------------------------------------- 
Line   acquia_connector.module                            
------ --------------------------------------------------- 
247    Call to deprecated function drupal_set_message().  
303    Call to deprecated function drupal_set_message().  
363    Call to deprecated function drupal_set_message().  
382    Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
------ --------------------------------------------------- 
Line   acquia_search/acquia_search.module                 
------ --------------------------------------------------- 
368    Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
------ -------------------------------------------------------------------------------------- 
Line   acquia_search/src/EventSubscriber/SearchSubscriber.php                                
------ -------------------------------------------------------------------------------------- 
24     Class Drupal\acquia_search\EventSubscriber\SearchSubscriber extends deprecated class  
Solarium\Core\Plugin\Plugin.                                                          
------ -------------------------------------------------------------------------------------- 
------ ------------------------------------------------------------------------- 
Line   acquia_search/src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php  
------ ------------------------------------------------------------------------- 
240    Call to deprecated function drupal_set_message().                        
240    Call to deprecated method l() of class Drupal.                           
------ ------------------------------------------------------------------------- 
------ --------------------------------------------------------------------------------------------------- 
Line   acquia_search/tests/modules/acquia_search_test/src/EventSubscriber/AcquiaSearchTestSubscriber.php  
------ --------------------------------------------------------------------------------------------------- 
26     Call to deprecated function drupal_set_message().                                                  
------ --------------------------------------------------------------------------------------------------- 
------ --------------------------------------------------------------------------------- 
Line   acquia_search/tests/src/Kernel/AcquiaSearchOverrideTest.php                      
------ --------------------------------------------------------------------------------- 
36     Call to deprecated method getMock() of class Drupal\KernelTests\KernelTestBase.  
------ --------------------------------------------------------------------------------- 
------ --------------------------------------------------- 
Line   src/Client.php                                     
------ --------------------------------------------------- 
167    Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
------ ------------------------------------------------------------ 
Line   src/Controller/SecurityReviewController.php                 
------ ------------------------------------------------------------ 
405    Call to deprecated function file_htaccess_lines().          
464    Call to deprecated method entityManager() of class Drupal.  
544    Call to deprecated method entityManager() of class Drupal.  
------ ------------------------------------------------------------ 
------ ------------------------------------------------------------------------------- 
Line   src/Controller/SpiController.php                                               
------ ------------------------------------------------------------------------------- 
357    Call to deprecated function db_select().                                       
387    Call to deprecated function db_select().                                       
419    Call to deprecated function db_select().                                       
441    Call to deprecated function db_select().                                       
459    Call to deprecated function db_select().                                       
501    Call to deprecated function db_select().                                       
539    Call to deprecated function drupal_get_profile().                              
615    Call to deprecated function db_query().                                        
641    Call to deprecated function db_select().                                       
659    Call to deprecated function db_query().                                        
674    Call to deprecated method substr() of class Drupal\Component\Utility\Unicode.  
928    Call to deprecated function db_select().                                       
932    Call to deprecated function db_select().                                       
936    Call to deprecated function db_select().                                       
958    Call to deprecated function drupal_set_message().                              
1025   Call to deprecated function drupal_set_message().                              
1032   Call to deprecated function drupal_set_message().                              
1036   Call to deprecated function drupal_set_message().                              
1041   Call to deprecated function drupal_set_message().                              
------ ------------------------------------------------------------------------------- 
------ ------------------------------------------------ 
Line   src/Controller/StartController.php              
------ ------------------------------------------------ 
32     Call to deprecated method l() of class Drupal.  
------ ------------------------------------------------ 
------ --------------------------------------------------- 
Line   src/Controller/TestStatusController.php            
------ --------------------------------------------------- 
47     Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
------ --------------------------------------------------- 
Line   src/Form/CredentialForm.php                        
------ --------------------------------------------------- 
70     Call to deprecated method url() of class Drupal.   
157    Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
------ --------------------------------------------------------------------- 
Line   src/Form/SettingsForm.php                                            
------ --------------------------------------------------------------------- 
110    Call to deprecated method url() of class Drupal\Core\Form\FormBase.  
123    Call to deprecated function drupal_set_message().                    
131    Call to deprecated method url() of class Drupal\Core\Form\FormBase.  
189    Call to deprecated method url() of class Drupal.                     
------ --------------------------------------------------------------------- 
------ --------------------------------------------------- 
Line   src/Form/SetupForm.php                             
------ --------------------------------------------------- 
88     Call to deprecated method url() of class Drupal.   
208    Call to deprecated function drupal_set_message().  
225    Call to deprecated function drupal_set_message().  
------ --------------------------------------------------- 
[ERROR] Found 44 errors  
CommentFileSizeAuthor
#20 interdiff_18-20.txt1.76 KBDane Powell
#20 acquia_connector-3036133-20.patch58.99 KBDane Powell
#18 acquia_connector-3036133-18.patch59.07 KBDane Powell
#17 acquia_connector-3036133-17.patch13.17 KBDane Powell
#14 interdiff-3036133-14.txt2.23 KBjoshi.rohit100
#14 remove-deprecated-apis-3036133-14.patch37.07 KBjoshi.rohit100
#13 remove-deprecated-apis-3036133-interdiff-12-13.txt627 bytesSharique
#13 remove-deprecated-apis-3036133-13.patch35.56 KBSharique
#12 remove-deprecated-apis-3036133-interdiff-10-12.txt4.27 KBSharique
#12 remove-deprecated-apis-3036133-12.patch35.05 KBSharique
#10 remove-deprecated-apis-3036133-interdiff-8-10.txt10.8 KBSharique
#10 remove-deprecated-apis-3036133-10.patch31.38 KBSharique
#8 remove-deprecated-apis-3036133-1.patch25.39 KBmaliknaik
#7 remove-deprecated-apis-3036133.patch25.38 KBmaliknaik
#6 3036133-6.patch12.29 KBbhanuprakashnani
#3 acquia_connector-3036133-3.patch25.44 KBsaesa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anavarre created an issue. See original summary.

saesa’s picture

Assigned: Unassigned » saesa
saesa’s picture

Status: Active » Needs review
FileSize
25.44 KB

Status: Needs review » Needs work

The last submitted patch, 3: acquia_connector-3036133-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

saesa’s picture

Assigned: saesa » Unassigned
bhanuprakashnani’s picture

Assigned: Unassigned » bhanuprakashnani
Status: Needs work » Needs review
FileSize
12.29 KB

I have changed the deprecated functions of drupal_set_message(). Please review and tell if any more changes are required. Thank you.

maliknaik’s picture

I've replaced the all the deprecated APIs from the project.

Replaced:

  1. drupal_set_message() with \Drupal::messenger()->addMessage().
  2. Instead of calling \Drupal::messenger() in the classes extending from ConfigFormBase and PluginBase I've used $this->messenger()->addMessage()
  3. Solarium\Core\Plugin\Plugin with Solarium\Core\Plugin\AbstractPlugin.
  4. db_select() with \Drupal::database()->select().
  5. db_query() with \Drupal::database()->query().
  6. drupal_get_profile() with \Drupal::installProfile().
  7. file_htaccess_lines(FALSE) with Drupal\Component\PhpStorage\FileStorage::htaccessLines(FALSE).
  8. \Drupal::entityManager() with \Drupal::entityTypeManager().
  9. \Drupal::l() with \Drupal\Core\Link::fromTextAndUrl()->toString().
  10. \Drupal::url() with \Drupal\Core\Url::fromRoute()->toString()
  11. \Drupal\KernelTests\KernelTestBase's getMock() method with getMockBuilder()->getMock()
maliknaik’s picture

maliknaik’s picture

Sharique’s picture

Updated patch to address mode deprecations.
Also updated tests for deprecations.

joshi.rohit100’s picture

Marked test to proceed without waiting for the branch to pass.

Sharique’s picture

Failing tests should be reduced by one,
AcquiaConnectorSpiTest is passing my local, but failing in ci.

joshi.rohit100’s picture

Patch#13 applied successfully but still there are some deprecation errors -

42/42 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------------------------------
  Line   acquia_search/acquia_search.install
 ------ --------------------------------------------------------------------------
  127    Call to deprecated function system_get_info():
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use
         \Drupal::service('extension.list.$type')->getExtensionInfo() or
         \Drupal::service('extension.list.$type')->getAllInstalledInfo() instead.
 ------ --------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------
  Line   src/Client.php
 ------ --------------------------------------------------------------------------
  148    Call to deprecated function system_get_info():
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use
         \Drupal::service('extension.list.$type')->getExtensionInfo() or
         \Drupal::service('extension.list.$type')->getAllInstalledInfo() instead.
 ------ --------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------
  Line   src/Controller/SpiController.php
 ------ --------------------------------------------------------------------------
  542    Call to deprecated function system_get_info():
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use
         \Drupal::service('extension.list.$type')->getExtensionInfo() or
         \Drupal::service('extension.list.$type')->getAllInstalledInfo() instead.
 ------ --------------------------------------------------------------------------

Fixing these error in the this patch and now there is no error

42/42 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

amitgoyal’s picture

Status: Needs review » Reviewed & tested by the community

After applying the patch in #14, there are no deprecations,

➜  ./vendor/mglaman/drupal-check/drupal-check --drupal-root=./ modules/contrib/acquia_connector

 42/42 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


 [OK] No errors

Kristen Pol’s picture

Issue tags: -D9Readiness +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

Dane Powell’s picture

Thanks for everyone's work on this so far. Here's the most recent patch that applies to 8.x-2.x (many of these deprecations were fixed in the recent 8.x-2.x release). The only thing that's lacking is the simpletest to PHPUnit conversions. I wasn't sure about the work related to that in previous patches.

Dane Powell’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
59.07 KB

I think this is 98% complete, just need to figure out a deprecation scanning issue. Hopefully it also fixes tests on d.o. Will need a backport to 8.x-1.x after it's merged.

Dane Powell’s picture

Hmm, the test failure seems like some kind of testbot internal error. No idea what's going on there. Opened #3102874: Ancillary require failure for support.

Dane Powell’s picture

Here's the final version of the patch, if we can just get the testbot working.

  • Dane Powell authored 200e8a1 on 8.x-2.x
    Issue #3036133 by Dane Powell, Sharique, maliknaik, joshi.rohit100,...
Dane Powell’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev
Status: Needs review » Needs work

Committed to 8.x-2.x, awaiting backport to 8.x-1.x

  • Dane Powell authored a657b85 on 8.x-1.x
    Issue #3036133 by Dane Powell, Sharique, maliknaik, joshi.rohit100,...
Dane Powell’s picture

Status: Needs work » Fixed

Thanks again to everyone who contributed to this issue.

Status: Fixed » Closed (fixed)

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