David N. Posted October 18, 2022 Share Posted October 18, 2022 When I try to access a specific private message I get the following error: Error: Call to a member function forMember() on null (0) #0 /home/logicpro/public_html/system/Dispatcher/Controller.php(118): IPS\core\modules\front\messaging\_messenger->manage() #1 /home/logicpro/public_html/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute() #2 /home/logicpro/public_html/applications/core/modules/front/messaging/messenger.php(67): IPS\Content\_Controller->execute() #3 /home/logicpro/public_html/system/Dispatcher/Dispatcher.php(153): IPS\core\modules\front\messaging\_messenger->execute() #4 /home/logicpro/public_html/index.php(13): IPS\_Dispatcher->run() #5 {main} Link to comment Share on other sites More sharing options...
Marc Stridgen Posted October 18, 2022 Share Posted October 18, 2022 Please could you provide a link to that message and let us know the user you are logged in as? David N. 1 Link to comment Share on other sites More sharing options...
David N. Posted October 18, 2022 Author Share Posted October 18, 2022 I was logged in as myself. The user was a spammer, so I've deleted him, so unfortunately I no longer have a link to his private message. I believe it's possible that when I tried to access the private message, the spammer had deleted it. Link to comment Share on other sites More sharing options...
Marc Stridgen Posted October 18, 2022 Share Posted October 18, 2022 All I can really suggest at this point, is to let us know if you see this happen again. We can then take it a look at that point in time Link to comment Share on other sites More sharing options...
Solution Nathan Explosion Posted October 18, 2022 Solution Share Posted October 18, 2022 (edited) Easily reproducible: Create an alert that requires the user to respond View the alert as a targeted user Send the required PM View the PM as the intended recipient - all good Delete the alert View the PM as the intended recipient - yep, it's f.... I've got 3 PMs on my test site that have this issue - and I know they are all associated with my alert testing, and all my alerts are since deleted. Stick a var_dump($conversation->alert); in before this, and you'll get NULL for a normal PM, and an integer for a PM that came as a result of an alert: if ($conversation->alert) { try { $alert = \IPS\core\Alerts\Alert::load($conversation->alert); } catch (\OutOfRangeException $e) { } if (!$alert->forMember(\IPS\Member::loggedIn())) { $alert = NULL; } } Edited October 18, 2022 by Nathan Explosion SeNioR-, David N., Adriano Faria and 1 other 4 Link to comment Share on other sites More sharing options...
Marc Stridgen Posted October 18, 2022 Share Posted October 18, 2022 Thanks Nathan. Have reported that internally as a bug SeNioR- and David N. 2 Link to comment Share on other sites More sharing options...
David N. Posted October 19, 2022 Author Share Posted October 19, 2022 Indeed this was a PM that was responding to an alert. Thank you @Nathan Explosion! Marc Stridgen 1 Link to comment Share on other sites More sharing options...
Recommended Posts