StevenJoynt / HumHub-Sponsor

HumHub module to track which members invited others to register at your web site.
GNU General Public License v3.0
1 stars 2 forks source link

Sponsor module is stack tracing when using invite links #3

Open dantefromhell opened 1 year ago

dantefromhell commented 1 year ago

HumHub now supports inviting new members by link.

After submitting the initial dialog that asks for the email address, the following stack-trace is written to the log file


2023-05-16 14:38:20 [172.18.0.1][-][-][error][application]
yii\base\ErrorException: Attempt to read property "id" on null in
/var/www/localhost/htdocs/protected/modules-custom/sponsor/Events.php:35
Stack trace:
#0
/var/www/localhost/htdocs/protected/modules-custom/sponsor/Events.php(35):
yii\base\ErrorHandler->handleError()
#1 [internal function]:
sij\humhub\modules\sponsor\Events::onAfterInsertInvite()
#2
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Event.php(312):
call_user_func()
#3
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Component.php(642):
yii\base\Event::trigger()
#4
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(998):
yii\base\Component->trigger()
#5
/var/www/localhost/htdocs/protected/humhub/components/ActiveRecord.php(83):
yii\db\BaseActiveRecord->afterSave()
#6
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(615):
humhub\components\ActiveRecord->afterSave()
#7
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/ActiveRecord.php(570):
yii\db\ActiveRecord->insertInternal()
#8
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/db/BaseActiveRecord.php(676):
yii\db\ActiveRecord->insert()
#9
/var/www/localhost/htdocs/protected/humhub/modules/user/controllers/RegistrationController.php(153):
yii\db\BaseActiveRecord->save()
#10 [internal function]:
humhub\modules\user\controllers\RegistrationController->actionByLink()
#11
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/InlineAction.php(57):
call_user_func_array()
#12
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Controller.php(178):
yii\base\InlineAction->runWithParams()
#13
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Module.php(552):
yii\base\Controller->runAction()
#14
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/web/Application.php(103):
yii\base\Module->runAction()
#15
/var/www/localhost/htdocs/protected/vendor/yiisoft/yii2/base/Application.php(384):
yii\web\Application->handleRequest()
#16 /var/www/localhost/htdocs/index.php(25):
yii\base\Application->run()
#17 {main}
    in
/var/www/localhost/htdocs/protected/modules-custom/sponsor/Events.php:40
    in
/var/www/localhost/htdocs/protected/humhub/components/ActiveRecord.php:83
2023-05-16 14:38:20 [172.18.0.1][-][-][info][application] $_GET = [
    'token' => '0H85_YMwczv0yj'
    'spaceId' => '23'
]

$_POST = [
    '_csrf' =>
'Q-n3uLGHC34YAT9ByLo9ujF2kMqgzqTbbnrdVQqFCvAFs7rpwr84NVVmcRKy30n8WhLIvuuPkL0jA6gtUMpZoQ=='
    'Invite' => [
        'email' => '[test.monkey.4@email.local](mailto:test.monkey.4@email.local)'
        'captcha' => 'namuoe'
    ]
]```
dantefromhell commented 1 year ago

Invite by link is a feature since HumHub 1.14, see https://docs.humhub.org/docs/about/releasenotes/release_notes_1_14