custom-pages
custom-pages copied to clipboard
Stack trace when mentioning user in Markdown page
When mentioning a user in a custom Markdown page + clicking save
the following strack-trace triggers
yii\base\Exception: Invalid polymorphic relation for Mentioning! in /var/www/localhost/htdocs/protected/humhub/modules/user/models/Mentioning.php:73
Stack trace:
#0 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(615): humhub\modules\user\models\Mentioning->afterSave()
#1 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(570): yii\db\ActiveRecord->insertInternal()
#2 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(676): yii\db\ActiveRecord->insert()
#3 /var/www/localhost/htdocs/protected/humhub/modules/user/models/Mentioning.php(160): yii\db\BaseActiveRecord->save()
#4 /var/www/localhost/htdocs/protected/humhub/modules/content/widgets/richtext/extensions/mentioning/MentioningExtension.php(109): humhub\modules\user\models\Mentioning::mention()
#5 /var/www/localhost/htdocs/protected/humhub/modules/content/widgets/richtext/AbstractRichText.php(234): humhub\modules\content\widgets\richtext\extensions\mentioning\MentioningExtension->onPostProcess()
#6 [internal function]: humhub\modules\content\widgets\richtext\AbstractRichText::postProcess()
#7 /var/www/localhost/htdocs/protected/humhub/modules/content/widgets/richtext/RichText.php(72): call_user_func()
#8 /var/www/localhost/htdocs/protected/modules/custom_pages/models/MarkdownType.php(37): humhub\modules\content\widgets\richtext\RichText::postProcess()
#9 /var/www/localhost/htdocs/protected/modules/custom_pages/models/CustomContentContainer.php(493): humhub\modules\custom_pages\models\MarkdownType->afterSave()
#10 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(615): humhub\modules\custom_pages\models\CustomContentContainer->afterSave()
#11 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(570): yii\db\ActiveRecord->insertInternal()
#12 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(676): yii\db\ActiveRecord->insert()
#13 /var/www/localhost/htdocs/protected/modules/custom_pages/controllers/PageController.php(215): yii\db\BaseActiveRecord->save()
#14 /var/www/localhost/htdocs/protected/modules/custom_pages/controllers/PageController.php(184): humhub\modules\custom_pages\controllers\PageController->savePage()
#15 [internal function]: humhub\modules\custom_pages\controllers\PageController->actionEdit()
#16 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#17 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams()
#18 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction()
#19 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction()
#20 /var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Application.php(384): yii\web\Application->handleRequest()
#21 /var/www/localhost/htdocs/index.php(25): yii\base\Application->run()
#22 {main}
Removing the mention from the same text works as expected.
HumHub version 1.11.2 custom_pages version 1.6.4
Steps to reproduce
- Create a new page of type markdown
- Add some text to the description including the mention of user (my own user in this case)
- Set page visibility to all users
The issue is not re-producable when editing an existing page and adding a mention.