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
Add validation to ensure that we are not trying to access attributes … #9795
Add validation to ensure that we are not trying to access attributes … #9795
Conversation
The other two issues mentioned in #9762 are not reproducible anymore. |
Codecov Report
@@ Coverage Diff @@
## features #9795 +/- ##
===========================================
Coverage 41.25% 41.25%
- Complexity 34563 34566 +3
===========================================
Files 2060 2060
Lines 111535 111535
===========================================
Hits 46014 46014
Misses 65521 65521
|
This pull request has been mentioned on Mautic Community Forums. There might be relevant details there: https://forum.mautic.org/t/notices-trying-to-access-array-offset-on-value-of-type-null/18008/9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohit-rocks This seems to resolve the issue for email - creating a new email using the Goldstar theme I no longer see the errors.
DWC does seem to have been fixed as that is no longer throwing an error for me.
Report saving is now throwing a different error for me:
[2021-03-19 19:18:13] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "PHP Warning - Illegal string offset 'column'" at /var/www/html/app/bundles/ReportBundle/Form/Type/FilterSelectorType.php line 88 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ContextErrorException(code: 0): PHP Warning - Illegal string offset 'column' at /var/www/html/app/bundles/ReportBundle/Form/Type/FilterSelectorType.php:88)
[stacktrace]
#0 /var/www/html/app/bundles/ReportBundle/Form/Type/FilterSelectorType.php(88): Mautic\\CoreBundle\\ErrorHandler\\ErrorHandler->handleError(2, 'PHP Warning - I...', '/var/www/html/a...', 88, Array)
#1 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(214): Mautic\\ReportBundle\\Form\\Type\\FilterSelectorType->Mautic\\ReportBundle\\Form\\Type\\{closure}(Object(Symfony\\Component\\Form\\FormEvent), 'form.pre_bind', Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))
#2 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'form.pre_bind', Object(Symfony\\Component\\Form\\FormEvent))
#3 /var/www/html/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php(33): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('form.pre_bind', Object(Symfony\\Component\\Form\\FormEvent))
#4 /var/www/html/vendor/symfony/form/Form.php(552): Symfony\\Component\\EventDispatcher\\ImmutableEventDispatcher->dispatch('form.pre_bind', Object(Symfony\\Component\\Form\\FormEvent))
#5 /var/www/html/vendor/symfony/form/Form.php(573): Symfony\\Component\\Form\\Form->submit(Array, true)
#6 /var/www/html/vendor/symfony/form/Form.php(573): Symfony\\Component\\Form\\Form->submit(Array, true)
#7 /var/www/html/vendor/symfony/form/Extension/HttpFoundation/HttpFoundationRequestHandler.php(109): Symfony\\Component\\Form\\Form->submit(Array, true)
#8 /var/www/html/vendor/symfony/form/Form.php(487): Symfony\\Component\\Form\\Extension\\HttpFoundation\\HttpFoundationRequestHandler->handleRequest(Object(Symfony\\Component\\Form\\Form), Object(Symfony\\Component\\HttpFoundation\\Request))
#9 /var/www/html/app/bundles/CoreBundle/Controller/AbstractFormController.php(167): Symfony\\Component\\Form\\Form->handleRequest(Object(Symfony\\Component\\HttpFoundation\\Request))
#10 /var/www/html/app/bundles/ReportBundle/Controller/ReportController.php(355): Mautic\\CoreBundle\\Controller\\AbstractFormController->isFormValid(Object(Symfony\\Component\\Form\\Form))
#11 /var/www/html/app/bundles/CoreBundle/Controller/CommonController.php(456): Mautic\\ReportBundle\\Controller\\ReportController->editAction('18', '')
#12 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Mautic\\CoreBundle\\Controller\\CommonController->executeAction('edit', '18', 0, '')
#13 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#14 /var/www/html/vendor/symfony/http-kernel/Kernel.php(200): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#15 /var/www/html/app/AppKernel.php(104): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#16 /var/www/html/app/middlewares/CORSMiddleware.php(91): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#17 /var/www/html/app/middlewares/CatchExceptionMiddleware.php(43): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#18 /var/www/html/app/middlewares/Dev/IpRestrictMiddleware.php(61): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#19 /var/www/html/app/middlewares/VersionCheckMiddleware.php(67): Mautic\\Middleware\\Dev\\IpRestrictMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#20 /var/www/html/app/middlewares/TrustMiddleware.php(51): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#21 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\TrustMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#22 /var/www/html/vendor/stack/run/src/Stack/run.php(13): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#23 /var/www/html/index_dev.php(25): Stack\
un(Object(Stack\\StackedHttpKernel))
#24 {main}
"}
This has fixed our email error too. |
https://youtu.be/-aTz-uQV9yo Here is a screencast of the error that I was seeing with the report - it was a few days ago but I am pretty sure that I checked at the time that it did not happen before the PR was applied. |
I was getting this error (I think it's the same) when trying to view a contacts report with a filter based on segment. Before the PR, I got this error in the log and a 500 in the browser: After applying the PR, I get this error in the log and a 500 error in the browser: Let me know if I can offer any more info and/or test again... |
@stevedrobinson I tried to fix that issue in last commit bb577a0 of this PR |
@mohit-rocks are you able to rebase this on features please, so it could be considered for 4.0? |
I retested in MautiBox and if I create a contacts report and add a filter for [Email] [is not empty] I get the following errors:
|
…re are no empty values for column.
bb577a0
to
4d62864
Compare
Thanks for working further on this @mohit-rocks - am now able to create reports (including with segment filters) without getting errors! Was this a 4.0 change that we have missed? If so let's make sure that we have it documented in the upgrade-4.0.md file. @stevedrobinson any chance you could re-test? |
@RCheesley Does this mean we can't create new reports / view old ones untill 4.0? |
This pull request has been mentioned on Mautic Community Forums. There might be relevant details there: |
We added the two files to Mautic 3.2.5. Updgrading to 3.3.3. fixed the problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes looks good to me.
@all-contributors please add @mohit-rocks for code |
I've put up a pull request to add @mohit-rocks! 🎉 |
@all-contributors please add @domparry for userTesting |
I've put up a pull request to add @domparry! 🎉 |
@all-contributors please add @sensalot for userTesting |
I've put up a pull request to add @sensalot! 🎉 |
@all-contributors please add @shinde-rahul for review |
I've put up a pull request to add @shinde-rahul! 🎉 |
Description:
Scenario 1:
Scenario 2:
Comment: #9795 (comment)
Scenario 3:
Comment: #9795 (comment)
Steps to test this PR: