php drupal-check.phar modules/contrib/open_readspeaker/
 3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------- 
  Line   src/Plugin/Block/OpenReadspeakerBlock.php          
 ------ --------------------------------------------------- 
  121    Call to deprecated function drupal_set_message().  
 ------ --------------------------------------------------- 

                                                                                                                        
 [ERROR] Found 1 error 

Comments

Sergiu Stici created an issue. See original summary.

sergiu stici’s picture

Status: Active » Needs review
StatusFileSize
new807 bytes

Here is the patch, please review.

sunlix’s picture

@Sergiu Stici

Thank you for reporting and providing the patch.
I think as of the current coding style guidelines we should switch to shorthand array syntax.

Switch from array() to []

I think multi-line array for placeholder are a little bit handier to read.

$this->messenger()->addMessage($this->t('Please go to @link and fill the account id.', [
  '@link' => l($this->t('manage open ReadSpeaker'), 'admin/config/services/open-readspeaker'),
]));
sunlix’s picture

@Sergiu Stici

the l() function on this line is also deprecated due to change record: https://www.drupal.org/node/2346779

sunlix’s picture

StatusFileSize
new1.2 KB

  • sunlix committed f8df232 on 8.x-1.x
    Issue #3090082 by Sergiu Stici, sunlix: Deprecated Code Report
    
sunlix’s picture

Status: Needs review » Fixed
sunlix’s picture

Status: Fixed » Closed (fixed)

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