Closed (duplicate)
Project:
Mailchimp E-Commerce
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 May 2019 at 08:06 UTC
Updated:
15 Jan 2025 at 21:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
neslee canil pintoRemoved deprecated drupal_set_message()
Comment #3
samuel.mortenson@neslee-canil-pinto The messenger() method is not defined in any of the classes it's added to in this patch, and $this is not available in .module files (only in class methods).
Comment #4
sahana _n commentedHi
I found some drupal_set_message deprecated method When I check the module with the "drupal-check" command.
------ ----------------------------------------------------------------------
Line src/StoreHandler.php
------ ----------------------------------------------------------------------
26 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.
51 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.
71 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/ProductHandler.php
------ ----------------------------------------------------------------------
38 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.
74 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.
79 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.
100 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.
128 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.
156 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.
233 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/OrderHandler.php
------ ----------------------------------------------------------------------
30 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.
64 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.
84 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/CustomerHandler.php
------ ----------------------------------------------------------------------
50 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.
89 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.
109 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.
------ ----------------------------------------------------------------------
I created the patch Please review the patch.
Comment #5
sahana _n commentedComment #6
scottsawyerThank you for the patch, it's a good start. Honestly though, I am not sure why we need our own messager, why not just use Drupal's?
Missing a single quote.
Comment #7
sahana _n commentedThanks for the review. ya we can use Drupal's messenger also, I created the patch for the single quote is missing please review the patch, if any mistakes are there please let me know
Thank you.
Comment #8
scottsawyerThanks for continuing to plug away at this. There are 2 failures, though I am not sure if the second fail is directly related to this patch.
For the first fail:
I could be totally wrong, but
seems to me like the problem is in this service.
This is more of a general question, why do we need this service? Why not just do something like:
Just curious, I just don't understand.
Comment #9
sahana _n commentedHi
Thanks for the review I have done changes in services please review the patch.
Comment #10
scottsawyerLooks good from a visual inspection. I will try to test it on an install soon. Thank you for your effort.
Comment #11
samuel.mortensonThere was a lot of usage of these classes that wasn't covered - new patch should update all instances.
Comment #12
carsteng commentedIn Relation to https://www.drupal.org/project/mailchimp_ecommerce/issues/3033720 I would prefer an option to hide...or remove the message completely.
There is no reason to present this message to a customer!
Comment #13
scottsawyerI agree that these messages shouldn't be displayed by default. However, I feel like this issue is just about removing 'drupal_set_message' as it's deprecated code. I think we should address whether or not, and under what conditions messages like this should be shown in the other ( related ) issue.
If I understand correctly, samuel.mortenson is not going to be maintaining this module any more, so we'll need someone to step up.
Comment #14
aprice42 commentedComment #15
millenniumtreeNow fielding calls from confused customers when these errors appear during checkout. Whatever mechanism you use to print them, please also add a checkbox so we can disable these messages instead of having to comment them out for every composer run or new release.
Comment #16
xenophyle commentedAddressed by #3033720: Allow to hide error messages on frontend