Closed (fixed)
Project:
Masquerade
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Dec 2018 at 23:16 UTC
Updated:
17 Feb 2019 at 20:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
andypostComment #3
govind.maloo commentedComment #4
chi commentedDoes that make sense to require Drupal Core 8.5+ in masquerade.info.yml and composer.json files?
Comment #5
andypost@Chi good point! makes a lot of sense
Comment #6
govind.maloo commentedComment #7
chi commentedBtw, the ControllerBase comes with MessengerTrait. So need to inject the messenger service as well as redirect destination.
Comment #8
andypostYep it was my bad in related issue - controller should use
redirectDestinationpropertyComment #9
ivanmaru commentedThere's no need to reinject the Messenger service in the controller's constructor, it already extends the class ControllerBase wich has the MessengerTrait.
Replaced the use of the property with the method messenger() from said MessengerTrait.
ContributionWeekend2019
Comment #10
chi commented$this->messengerproperty is NULL by default. I think it is better to rely on$this->messanger().Comment #11
andypostCNW for #10
Comment #12
elamanAssigning
Comment #13
elamanPatch addressing #10
Comment #14
elamanComment #16
elamanComment #18
elamanTests passed after inconsistently failing, because of random build errors.
Comment #19
hchang commentedI can confirm #13 is working who can update this to fixed?
Comment #20
chi commented#7 needs to be addressed.
Comment #21
neslee canil pintoReplaced drupal set message with messenger service
Comment #22
chi commented@Neslee Canil Pinto, the path is 65 KB. Did you upload correct file?
Comment #23
neslee canil pintoReplaced drupal set message with messenger service
Comment #24
elaman@chi it is addressed in #13
@neslee-canil-pinto that patch is an exact copy of the patch #13
Comment #25
chi commentedPatch in #23 is exact like in #13.
Comment #26
chi commentedLet's summarize the task.
There is no need to inject messenger service to constructor. The controller extends BaseController which uses MessengerTrait.
However there is a small important detail about accessing the messenger. The trait instantiates the messenger lazily.
This means you should access the messenger through
$this->messenger()method not through$this->messengerproperty. Given that the whole issue is just about replacingdrupal_set_message()with$this->messenger()->addStatus()or$this->messenger()->addError().Comment #27
elaman@chi thank you for clarifications
Comment #28
chi commentedLooks good for me. Thanks.
Comment #29
andypostI see no reason in second line, so gonna commit with this change
Comment #31
andypostComment #32
andypostDoes it needs follow-up to update composer requirements?