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

Segment filters based on entity select box fixes #8279

Merged
merged 1 commit into from Jan 7, 2020

Conversation

escopecz
Copy link
Sponsor Member

@escopecz escopecz commented Jan 2, 2020

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Y
New feature? N
Automated tests included? N
Related user documentation PR URL /
Related developer documentation PR URL /
Issues addressed (#s or URLs) /
BC breaks? N
Deprecations? N

Description:

@dongilbert noticed that the segment filters based on entity select boxes does not work correctly. This PR fixes that.

Steps to reproduce the bug:

  1. Create a new segment filter based on asset downloads.
  2. Change filter to including so you could see the select box.
  3. Notice the list looks correct. You can see the asset IDs instead of labels.
  4. Save the segment.
  5. You get a validation error and if you check the asset select box now you can see labels instead of IDs.

Steps to test this PR:

  1. Load up this PR
  2. Follow the steps now. There should not be any IDs visible in the select box and no validation error.

@escopecz escopecz added ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging Mautic 3 labels Jan 2, 2020
@escopecz escopecz added this to the 3.0.0 milestone Jan 2, 2020
@escopecz escopecz added this to Needs code review and/or test in Mautic 3 Jan 2, 2020
@escopecz escopecz self-assigned this Jan 2, 2020
@hluchas hluchas self-requested a review January 2, 2020 14:56
Copy link
Contributor

@hluchas hluchas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to create new asset. I know that this could not be part of this fix, but I can't test it for now.

Error produced on URL /index_dev.php/s/assets/new

[2020-01-02 14:55:17] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\InvalidArgumentException: "Could not load type "datetime": class does not implement "Symfony\Component\Form\FormTypeInterface"." at /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormRegistry.php line 89 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\InvalidArgumentException(code: 0): Could not load type \"datetime\": class does not implement \"Symfony\\Component\\Form\\FormTypeInterface\". at /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormRegistry.php:89)
[stacktrace]
#0 /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormFactory.php(74): Symfony\\Component\\Form\\FormRegistry->getType('datetime')
#1 /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormBuilder.php(98): Symfony\\Component\\Form\\FormFactory->createNamedBuilder('publishUp', 'datetime', NULL, Array)
#2 /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormBuilder.php(252): Symfony\\Component\\Form\\FormBuilder->create('publishUp', 'datetime', Array)
#3 /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormBuilder.php(199): Symfony\\Component\\Form\\FormBuilder->resolveChildren()
#4 /Users/lukas.drahy/dev/community-fork/vendor/symfony/form/FormFactory.php(30): Symfony\\Component\\Form\\FormBuilder->getForm()
#5 /Users/lukas.drahy/dev/community-fork/app/bundles/AssetBundle/Model/AssetModel.php(388): Symfony\\Component\\Form\\FormFactory->create('Mautic\\\\AssetBun...', Object(Mautic\\AssetBundle\\Entity\\Asset), Array)
#6 /Users/lukas.drahy/dev/community-fork/app/bundles/AssetBundle/Controller/AssetController.php(327): Mautic\\AssetBundle\\Model\\AssetModel->createForm(Object(Mautic\\AssetBundle\\Entity\\Asset), Object(Symfony\\Component\\Form\\FormFactory), '/index_dev.php/...')
#7 /Users/lukas.drahy/dev/community-fork/app/bundles/CoreBundle/Controller/CommonController.php(474): Mautic\\AssetBundle\\Controller\\AssetController->newAction(Object(Mautic\\AssetBundle\\Entity\\Asset), '')
#8 /Users/lukas.drahy/dev/community-fork/vendor/symfony/http-kernel/HttpKernel.php(151): Mautic\\CoreBundle\\Controller\\CommonController->executeAction('new', 0, 0, '')
#9 /Users/lukas.drahy/dev/community-fork/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#10 /Users/lukas.drahy/dev/community-fork/vendor/symfony/http-kernel/Kernel.php(200): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#11 /Users/lukas.drahy/dev/community-fork/app/AppKernel.php(141): Symfony\\Component\\HttpKernel\\Kernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#12 /Users/lukas.drahy/dev/community-fork/app/middlewares/CORSMiddleware.php(93): AppKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#13 /Users/lukas.drahy/dev/community-fork/app/middlewares/CatchExceptionMiddleware.php(45): Mautic\\Middleware\\CORSMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#14 /Users/lukas.drahy/dev/community-fork/app/middlewares/Dev/IpRestrictMiddleware.php(66): Mautic\\Middleware\\CatchExceptionMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#15 /Users/lukas.drahy/dev/community-fork/app/middlewares/VersionCheckMiddleware.php(55): Mautic\\Middleware\\Dev\\IpRestrictMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#16 /Users/lukas.drahy/dev/community-fork/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Mautic\\Middleware\\VersionCheckMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#17 /Users/lukas.drahy/dev/community-fork/vendor/stack/run/src/Stack/run.php(13): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#18 /Users/lukas.drahy/dev/community-fork/index_dev.php(24): Stack\
un(Object(Stack\\StackedHttpKernel))
#19 {main}
"} 

Issue created #8282

EDIT:
I tried tags and form selects are empty
Snímek obrazovky 2020-01-02 v 16 32 51

Fixed in other issue

@hluchas
Copy link
Contributor

hluchas commented Jan 3, 2020

operators in app/bundles/LeadBundle/Assets/js/lead.js:667 is undefined for me in case of using Asset downloads filter
Snímek obrazovky 2020-01-03 v 16 47 50

@escopecz escopecz added the essential This must be done to close the milestone label Jan 6, 2020
@escopecz
Copy link
Sponsor Member Author

escopecz commented Jan 6, 2020

I cannot replicate the issue. Can someone else test it?
Screenshot 2020-01-06 at 17 24 43

Copy link
Contributor

@mtshaw3 mtshaw3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears to be working for me
image

@dongilbert dongilbert merged commit 8157f98 into mautic:3.x Jan 7, 2020
@escopecz escopecz moved this from Needs code review and/or test to Done in Mautic 3 Jan 7, 2020
@escopecz escopecz removed code-review-needed PR's that require a code review before merging essential This must be done to close the milestone ready-to-test PR's that are ready to test labels Jan 8, 2020
@escopecz escopecz deleted the m3.entity-filters branch January 8, 2020 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Mautic 3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants