Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversations not loading - TypeError in InboxMessagePreview widget #404

Open
marc-farre opened this issue Jul 12, 2024 · 0 comments
Open

Comments

@marc-farre
Copy link
Contributor

marc-farre commented Jul 12, 2024

Original post: https://community.humhub.com/content/perma?id=279398

Seams to be a database integrity issue.
However, it should still load, ignoring missing conversations.

The issue is the return type of InboxMessagePreview::getMessage() which is Message and, I think, should be changed to ?Message.
But we need to check the consequences of this change.

Log:

TypeError: humhub\modules\mail\widgets\InboxMessagePreview::getMessage(): Return value must be of type humhub\modules\mail\models\Message, null returned in /var/www/html/carrotsocial/protected/modules/mail/widgets/InboxMessagePreview.php:59
Stack trace:
#0 /var/www/html/carrotsocial/protected/modules/mail/widgets/InboxMessagePreview.php(151): humhub\modules\mail\widgets\InboxMessagePreview->getMessage()
#1 /var/www/html/carrotsocial/protected/modules/mail/widgets/InboxMessagePreview.php(25): humhub\modules\mail\widgets\InboxMessagePreview->getLastEntry()
#2 /var/www/html/carrotsocial/protected/humhub/components/Widget.php(62): humhub\modules\mail\widgets\InboxMessagePreview->run()
#3 /var/www/html/carrotsocial/protected/modules/mail/views/mail/notificationList.php(10): humhub\components\Widget::widget()
#4 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/View.php(348): require('...')
#5 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/View.php(258): yii\base\View->renderPhpFile()
#6 /var/www/html/carrotsocial/protected/humhub/modules/ui/view/components/View.php(243): yii\base\View->renderFile()
#7 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/web/Controller.php(50): humhub\modules\ui\view\components\View->renderAjax()
#8 /var/www/html/carrotsocial/protected/modules/mail/controllers/MailController.php(208): yii\web\Controller->renderAjax()
#9 [internal function]: humhub\modules\mail\controllers\MailController->actionNotificationList()
#10 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#11 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#12 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#13 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#14 /var/www/html/carrotsocial/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#15 /var/www/html/carrotsocial/index.php(28): yii\base\Application->run()
#16 {main}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants