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
Cannot merge company with itself #13578
base: 5.x
Are you sure you want to change the base?
Conversation
b49a218
to
bd4e484
Compare
app/bundles/CoreBundle/Form/ChoiceLoader/EntityLookupChoiceLoader.php
Outdated
Show resolved
Hide resolved
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.
Works great - I don't see the current company in the list of available companies to merge into:
Thanks for the PR @nishant-s7 and welcome to the community! 🚀
Looks like there's still some issues which need to be addressed with the automated tests here @nishant-s7 - I've marked this for a second user test, please shout if you need help with addressing the test failures. |
I think the tests are failing because I added 'model_lookup_method' => 'getSimpleLookupResults',
'lookup_arguments' => fn (Options $options): array => [
'type' => 'lead.company',
'exclude' => $options['main_entity'],
], to Thanks! |
2ac03e8
to
2b69b91
Compare
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.
Worked as described when tested 👍
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 5.x #13578 +/- ##
============================================
- Coverage 61.38% 61.31% -0.07%
+ Complexity 34024 34012 -12
============================================
Files 2238 2238
Lines 101685 101679 -6
============================================
- Hits 62420 62349 -71
- Misses 39265 39330 +65
|
2b69b91
to
eb5a3ac
Compare
Hello! How do I address this test failure?
|
It's a network issue. I restarted the failed job |
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.
Looking good! Tests failing again though. Seems to be happening on other PR's as well since couple of days.
It's usually just a temporary issue. I re-triggered it again. @nishant-s7 by the rule book each PR should have a test covering the change functions as it should so it won't get broken with future changes and the whole platform is more stable. Do you know how to write a functional test? There are many examples of such test in each bundle. If you'll need help, feel free to ask here for on Slack. |
I've never written any functional tests, but I'll try to do so by referring to the examples👍 |
@nishant-s7 thanks! You can check for example https://github.com/mautic/mautic/blob/5.x/app/bundles/LeadBundle/Tests/Functional/Controller/LeadControllerTest.php#L38 The test should:
|
Hello!
but it throws this error |
@nishant-s7, Use this |
Hi @shinde-rahul , on trying this, i got this error: |
I usually run specific tests with
Those are weird failures. Do you have the right PHP version and composer dependencies installed? If you use DDEV or other container setup for development, you have to run the test from the container. So in case of DDEV you'd firstly |
eb5a3ac
to
d84d8bd
Compare
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.
Nice test! Thanks! Please check my question and a suggestion.
Co-authored-by: John Linhart <jan@linhart.email>
Co-authored-by: John Linhart <jan@linhart.email>
504292f
to
b3e268c
Compare
Description:
This PR blocks the possibility of merging a company with itself by not showing the company in the merge list.
Steps to test this PR:
Companies
and click on any company.Merge
(available in the header options).Search options
, verify whether the currently viewed company is present or not.