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

Import from Group: Request missing required body param #425

Closed
apitel opened this issue Oct 22, 2023 · 5 comments
Closed

Import from Group: Request missing required body param #425

apitel opened this issue Oct 22, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@apitel
Copy link

apitel commented Oct 22, 2023

Hi Ben,

I'm using Campaign 2.9.1. I am encountering an issue where I am unable to import from a Craft User Group. I can import from a .csv without issue, but it throws the following error when trying to import from Craft User Group: "Bad Request: Request missing required body param"

I am keeping it very simple and there is only one user in the User Group. Below is a dump from the error log.

Any help you can provide on this issue would be greatly appreciated. Thank you!

yii\web\BadRequestHttpException: Request missing required body param in /Users/apitel/Sites/mpe/vendor/craftcms/cms/src/web/Request.php:913
Stack trace:
#0 /Users/apitel/Sites/mpe/vendor/putyourlightson/craft-campaign/src/controllers/ImportsController.php(300): craft\web\Request->getRequiredBodyParam('assetId')
#1 /Users/apitel/Sites/mpe/vendor/putyourlightson/craft-campaign/src/controllers/ImportsController.php(187): putyourlightson\campaign\controllers\ImportsController->getImportModelFromParams('field')
#2 [internal function]: putyourlightson\campaign\controllers\ImportsController->actionImportUserGroup()
#3 /Users/apitel/Sites/mpe/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#4 /Users/apitel/Sites/mpe/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#5 /Users/apitel/Sites/mpe/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('import-user-gro...', Array)
#6 /Users/apitel/Sites/mpe/vendor/craftcms/cms/src/web/Application.php(304): yii\base\Module->runAction('campaign/import...', Array)
#7 /Users/apitel/Sites/mpe/vendor/craftcms/cms/src/web/Application.php(607): craft\web\Application->runAction('campaign/import...', Array)
#8 /Users/apitel/Sites/mpe/vendor/craftcms/cms/src/web/Application.php(283): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#9 /Users/apitel/Sites/mpe/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#10 /Users/apitel/Sites/mpe/public/index.php(12): yii\base\Application->run()
#11 /Users/apitel/.composer/vendor/laravel/valet/server.php(234): require('/Users/apitel/S...')
#12 {main}

@apitel apitel added the bug Something isn't working label Oct 22, 2023
@bencroker
Copy link
Collaborator

Thanks for the bug report. I can confirm that this is indeed an issue and should be able to release a fix in the next day or two.

@bencroker bencroker self-assigned this Oct 23, 2023
@bencroker
Copy link
Collaborator

bencroker commented Oct 24, 2023

I’ve fixed this issue in 321478b for the next release.

You can test this by running composer require "putyourlightson/craft-campaign:dev-develop as 2.9.2".

@bencroker
Copy link
Collaborator

Released in 2.9.2.

@mathieuser
Copy link

Hi Ben, I've stumbled on this error as well. I've updated, but I get another error now when trying to sync users: I'm getting:

foreach() argument must be of type array|object, null given

This seems to happen in the foreach loop where firstName and lastName are being requested...
Is this something you can replicate, or might this be a bug on my side?

Thanks!

@bencroker
Copy link
Collaborator

Since this issue is closed and may be different, please create a new issue with more details and a full stack trace from the logs, if there is one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants