drupal_set_message() has been deprecated in favor of the messenger service.Patch incoming.

https://www.drupal.org/node/2774931

Comments

nkoporec created an issue. See original summary.

nkoporec’s picture

Assigned: nkoporec » Unassigned
Status: Active » Needs review
StatusFileSize
new13.26 KB

Created a patch.

useernamee’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies and all calls to drupal_set_message() are changed with the messanger service.

Status: Reviewed & tested by the community » Needs work

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

aspilicious’s picture

Tests are failing because you changed the constructor of "FieldFormBase" but you didn't adjust the other implementations.
In fact I'm reluctant to commit this because of that change, as it will break all custom implementations that extend our base class. And I know there are some.

Could you maybe not inject the messenger service for this class and just fetch the service with the Drupal::service helper function?

vdenis’s picture

StatusFileSize
new11.22 KB

Attached the updated patch. Please review it.

vdenis’s picture

Status: Needs work » Needs review

Tests passed so marking this as "needs review".

swentel’s picture

Status: Needs review » Closed (outdated)

drupal_set_message was removed in a different patch.