------ ----------------------------------------------------------------------
Line src/Controller/ProductReviewController.php
------ ----------------------------------------------------------------------
57 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Form/ProductReviewForm.php
------ ----------------------------------------------------------------------
139 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line src/Form/ProductReviewTypeForm.php
------ ----------------------------------------------------------------------
121 Call to deprecated function drupal_set_message():
in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
Use \Drupal\Core\Messenger\MessengerInterface::addMessage() instead.
------ ----------------------------------------------------------------------
Comment | File | Size | Author |
---|---|---|---|
#6 | 3098614-6.patch | 2.12 KB | Deeksha B |
#4 | 3098614-4.patch | 2.11 KB | Deeksha B |
#2 | 3098614-2.patch | 2.12 KB | Deeksha B |
Comments
Comment #2
Deeksha B CreditAttribution: Deeksha B at Specbee commentedPlease review the patch.
Comment #3
agoradesign CreditAttribution: agoradesign commentedthx.. although it looks good, I'd want to see a small change: please use "addStatus" instead of "addMessage"... although the latter one defaults to status type, it is far more readable to use the dedicated method. That's why I'm preferring the dedicated ones
Comment #4
Deeksha B CreditAttribution: Deeksha B at Specbee commentedI have updated the changes, Please review.
Comment #5
agoradesign CreditAttribution: agoradesign commentedSorry, there's another mistake I've just recognized. And it's a really important one. You are directly accessing the $this->messenger property, but this is not guaranteed to be set. The forms as well as the controller are using the MessengerTrait and never use the explicit setter, which is ok, but in order to be always safe to get a messenger instance, you must rather call $this->messenger() than accesing $this->messenger. This two brackets are a small but very important difference here!
Comment #6
Deeksha B CreditAttribution: Deeksha B at Specbee commentedSorry, That was a mistake from my end, I have updated the changes.
Comment #8
agoradesign CreditAttribution: agoradesign commentedThat's fine now! Thanks :)