drupal_set_message() deprecated for drupal 9, need to remove drupal_set_message() method

Comments

joy29 created an issue. See original summary.

rudranil29’s picture

StatusFileSize
new827 bytes

here is the patch

rudranil29’s picture

Assigned: rudranil29 » Unassigned
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: openapi-3070671-1.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

rudranil29’s picture

Status: Needs work » Needs review
richgerdes’s picture

Status: Needs review » Needs work

This should be using dependency injection not using a static call to \Drupal::messenger()

a.dreichan’s picture

Hello, please review my patch!

a.dreichan’s picture

Status: Needs work » Needs review
Iryna Milinchuk’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed patch #7
Works well for me. Thanks!

i-trokhanenko’s picture

+1 RTBC

phenaproxima’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.27 KB

Running drupal-check on HEAD of OpenAPI, with this patch applied, still gives me an error:

------ ----------------------------------------------------------------------------- 
  Line   openapi.install                                                              
 ------ ----------------------------------------------------------------------------- 
  14     Call to deprecated function system_rebuild_module_data():                    
         in drupal:8.8.0 and is removed from drupal:9.0.0.                            
         Use \Drupal::service('extension.list.module')->getList() instead.            
         Note: use reset() only when you really need to rescan and rebuild the list.  
 ------ ----------------------------------------------------------------------------- 

Attached is a patch which fixes this one too.

phenaproxima’s picture

StatusFileSize
new2.04 KB

Hmm...it looks like the test will need to be updated for compatibility with the path_alias module in D8.8. I'll leave that to someone else who knows more than I do, and possibly a follow-up issue.

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Drupal 9 compatibility, +API-First Initiative
+++ b/tests/src/Functional/RequestTest.php
@@ -373,6 +373,11 @@ class RequestTest extends BrowserTestBase {
+    // @todo Update the expectations to include path alias stuff, and then
+    // delete these unset() calls.
+    unset($decoded_response['definitions']['path_alias--path_alias']);
+    unset($decoded_response['paths']['/path_alias/path_alias']);
+    unset($decoded_response['paths']['/path_alias/path_alias/{entity}']);

This is because in Drupal 8.8, path aliases became entities. Makes sense to not fix that here, to keep scope tight.

phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, @richgerdes!

richgerdes’s picture

Thanks all for working on this! I've committed the patch against 1.x and opened #3110131: Upgrade tests to be compatible with path_alias module in D8.8 to track fixes in the tests. These issues were already fixed when the 2.x version was implemented.

Status: Fixed » Closed (fixed)

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