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

Error 500 When Saving a Marketing Message Using "Save and Close" Button #14469

Open
1 task done
shinde-rahul opened this issue Jan 17, 2025 · 0 comments
Open
1 task done
Labels
bug Issues or PR's relating to bugs marketing-messages needs-triage For new issues/PRs that need to be triaged

Comments

@shinde-rahul
Copy link
Contributor

shinde-rahul commented Jan 17, 2025

Mautic Series

6.0.x series

Mautic installed version

6.x

Way of installing

I cloned the Mautic repo (not recommended or supported)

PHP version

8.3.14

What browsers are you seeing the problem on?

No response

What happened?

When attempting to create a marketing message and clicking the "Save and Close" button or opening the details page for marketing message, the following error occurs:

500 Internal Server Error - Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given.

Proposed Fix

The issue might be resolved by updating the code at the following location:AbstractStandardFormController.php#L769.
Replace the existing line with:

$dateRangeValues = $request->$method->all()['daterange'] ?? [];

How can we reproduce this issue?

Step 1: Go to Marketing Messages.
Step 2: Create a new marketing message by filling in the required details.
Step 3: Click on the "Save and Close" button.
Step 4: Observe the error message displayed.

Relevant log output

mautic.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given." at /var/www/html/vendor/symfony/http-foundation/InputBag.php line 32 {"exception":"[object] (InvalidArgumentException(code: 0): Expected a scalar value as a 2nd argument to \"Symfony\\Component\\HttpFoundation\\InputBag::get()\", \"array\" given. at /var/www/html/vendor/symfony/http-foundation/InputBag.php:32)
[stacktrace]
#0 /var/www/html/app/bundles/CoreBundle/Controller/AbstractStandardFormController.php(769): Symfony\\Component\\HttpFoundation\\InputBag->get()
#1 /var/www/html/app/bundles/ChannelBundle/Controller/MessageController.php(132): Mautic\\CoreBundle\\Controller\\AbstractStandardFormController->getViewDateRange()
#2 /var/www/html/app/bundles/CoreBundle/Controller/AbstractStandardFormController.php(1131): Mautic\\ChannelBundle\\Controller\\MessageController->getViewArguments()
#3 /var/www/html/app/bundles/ChannelBundle/Controller/MessageController.php(94): Mautic\\CoreBundle\\Controller\\AbstractStandardFormController->viewStandard()
#4 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Mautic\\ChannelBundle\\Controller\\MessageController->viewAction()
#5 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw()
#6 /var/www/html/vendor/symfony/framework-bundle/Controller/AbstractController.php(122): Symfony\\Component\\HttpKernel\\HttpKernel->handle()
#7 /var/www/html/app/bundles/CoreBundle/Controller/CommonController.php(412): Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController->forward()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Mautic\\CoreBundle\\Controller\\CommonController->executeAction()
#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw()
#10 /var/www/html/vendor/symfony/http-kernel/Kernel.php(197): Symfony\\Component\\HttpKernel\\HttpKernel->handle()
#11 /var/www/html/app/AppKernel.php(101): Symfony\\Component\\HttpKernel\\Kernel->handle()
#12 /var/www/html/app/middlewares/CORSMiddleware.php(76): AppKernel->handle()
#13 /var/www/html/app/middlewares/HSTSMiddleware.php(39): Mautic\\Middleware\\CORSMiddleware->handle()
#14 /var/www/html/app/middlewares/CatchExceptionMiddleware.php(28): Mautic\\Middleware\\HSTSMiddleware->handle()
#15 /var/www/html/app/middlewares/Dev/IpRestrictMiddleware.php(52): Mautic\\Middleware\\CatchExceptionMiddleware->handle()
#16 /var/www/html/app/middlewares/VersionCheckMiddleware.php(58): Mautic\\Middleware\\Dev\\IpRestrictMiddleware->handle()
#17 /var/www/html/app/middlewares/TrustMiddleware.php(42): Mautic\\Middleware\\VersionCheckMiddleware->handle()
#18 /var/www/html/app/middlewares/StackedHttpKernel.php(55): Mautic\\Middleware\\TrustMiddleware->handle()
#19 /var/www/html/index.php(19): Mautic\\Middleware\\StackedHttpKernel->handle()
#20 {main}

Code of Conduct

  • I confirm that I have read and agree to follow this project's Code of Conduct
@shinde-rahul shinde-rahul added bug Issues or PR's relating to bugs needs-triage For new issues/PRs that need to be triaged marketing-messages labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs marketing-messages needs-triage For new issues/PRs that need to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant