Remove deprecated drupal_set_message()
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3049611. --> Reported by: [feyp](https://www.drupal.org/user/998680) >>> <h2>Synopsis</h2> <p>We want a smooth upgrade path to Drupal 9, so we want to remove deprecated code from the module.</p> <h2>Discussion</h2> <p>Current <a href="https://github.com/mglaman/drupal-check">drupal_check</a> report:</p> <pre>------ --------------------------------------------------- <br>&nbsp; Line&nbsp;&nbsp; src/Form/ConfigurationForm.php&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> ------ --------------------------------------------------- <br>&nbsp; 97&nbsp;&nbsp;&nbsp;&nbsp; Call to deprecated function drupal_set_message().&nbsp; <br>&nbsp; 107&nbsp;&nbsp;&nbsp; Call to deprecated function drupal_set_message().&nbsp; <br> ------ --------------------------------------------------- <br><br> ------ --------------------------------------------------- <br>&nbsp; Line&nbsp;&nbsp; src/Tracker.php&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> ------ --------------------------------------------------- <br>&nbsp; 153&nbsp;&nbsp;&nbsp; Call to deprecated function drupal_set_message().&nbsp; <br> ------ --------------------------------------------------- </pre><h2>Proposed resolution</h2> <p><code>drupal_set_message()</code> was deprecated during the 8.5 cycle, but we can't depend on patch releases due to <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-3"><a href="https://www.drupal.org/project/drupal/issues/2641658" title="Status: Closed (duplicate)">#2641658: Module version dependency in .info.yml is ineffective for patch releases</a></span>, so we would need to depend on 8.6. Since 8.7 is scheduled for release in May and 8.5 security support will end at that time, now is probably a good time to introduce a dependency on 8.6 for the next release. So the plan would be to depend on 8.6 and start using <code>MessengerTrait</code>.</p>
issue