uses of drupal_set_message()

Created on 12 May 2022, over 2 years ago
Updated 13 August 2024, 4 months ago

Problem/Motivation

The latest version is supposed to be D9-compatible, but it has calls to drupal_set_message() which is removed in D9.
In gitlab it is reported under phpstan: https://git.drupalcode.org/project/entity/-/jobs/2338012#L57

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.0

Component

Core integration

Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Merge request !20Issue #3280175: uses of drupal_set_message() → (Open) created by Guietc
  • First commit to issue fork.
  • Pipeline finished with Success
    4 months ago
    Total: 172s
    #246572
  • 🇮🇳India ankitv18

    @berdir as phpstan also reports this issue
    As per #2 do we need to remove this form in the next release?

  • Pipeline finished with Success
    4 months ago
    Total: 321s
    #246585
  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    There is no need for DI here, it just adds more phpstan messages at the moment. This is an entity form that uses the messenger trait, you can use messenger(), especially on dead code that nobody should be using anymore.

  • Pipeline finished with Success
    4 months ago
    Total: 140s
    #250740
  • Pipeline finished with Success
    4 months ago
    Total: 151s
    #250747
  • Status changed to Needs review 4 months ago
  • 🇮🇳India ankitv18

    Yeah it's a dead code ~~ so don't know whether this needs to be merged or whole form gets removed!!

  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    You must use the messenger() method, not the property directly.

    It is deprecated and scheduled for removal, but that will require a new major version, which will likely not happen soon if ever.

  • Pipeline finished with Success
    4 months ago
    Total: 147s
    #251133
  • Status changed to Needs review 4 months ago
  • 🇮🇳India ankitv18

    Used \Drupal::messenger(); moving into review

  • Status changed to Needs work 4 months ago
  • 🇺🇸United States tr Cascadia

    No, shouldn't be \Drupal::messenger(), should be $this->messenger(). Read what @berdir wrote in #11.

  • Status changed to Needs review 4 months ago
  • 🇮🇳India ankitv18

    Ahh I got bit confused with messenger, Thanks @TR

  • Pipeline finished with Success
    4 months ago
    Total: 145s
    #252281
Production build 0.71.5 2024