Bug: Company Field Empty and Uneditable in Contact Records After Import

Description:
After importing companies and contacts into the production system, many contacts show an empty company field, and the field cannot be edited. The issue does not occur in the test environment.

Steps to Reproduce:

  1. Import companies and contacts into a test instance (small dataset).

  2. Verify that contact company fields and company contact counts are correct.

  3. Import the same dataset into the production instance (large dataset).

  4. Observe that:

    • Many companies have a contact count of zero.

    • For contacts where a company is displayed, the company field is empty and cannot be edited.

Expected Behavior:

  • Contact company fields should correctly display the associated company.

  • The company field should be editable.

Actual Behavior:

  • Contact company field is empty or uneditable in production.

  • Company count is zero in many cases.

Environment:

  • Mautic version: 6.0.3

  • PHP Same for test and production

  • MariaDB Same for test and production

  • Test system: small dataset

  • Production system: large dataset

Notes:

  • Database records appear correct.

  • The issue may be related to editing a contact custom field.

Thanks

Mautic Import Issue – Partial Company-Contact Link Failure

I’ve been importing companies and contacts in batches of around 50 using the browser import feature without any noticing any issues.

However, when importing a smaller batch (10 companies and 10 contacts), I encountered a problem:
* The import worked successfully on a test instance.
* The same import failed on the production instance.

Details:

| Companies | Contacts | Result |
| --------------——| --------—— | ------------------------------ --------———|
| 10 | 10 | 7 imported correctly, 3 failed |

For 3 out of 10 companies, the related contacts showed zero linked companies.

I found that these missing relationships corresponded to 3 missing rows in the `companies_leads` table.

No errors reported in the logs.

After manually adding the missing rows to the database, the company contact totals became correct, and the links started working.

However, the company name field for those affected contacts remains blank and are uneditable—still investigating the cause.

Conclusion:

The import feature in Mautic 6.0.3 is not fully reliable, particularly for company-contact relationships duringbrowser batch imports. I would kindly ask the the developers to investigate further.

Thanks.

Mautic Import Issue – Uneditable Company Name

For the three failed imports as defined above if you edit the contact you cant delete the assigned company because its already blank and if you try and assign the same company this time it is missing “<small">” from the correct company name in the company list. If you save it, it is always blank when reopened.

If you pull down the company list under normal operation then they always have “<small">” in the company name. The failed one dont on my production instance how the test instance is correct.

Does anyone know how to resolve this problem ?

Thanks.

Hello,

Ive done some more testing and I have found the root problem.

The missing company field is not related to importing or adding a custom field entry.

The root problem is with Mautic 6.0.3 which I’m running on my production instance.

If you edit a contact that has an assigned company and make no changes and save and exit then the company is removed from the contact. And the row is being deleted from `companies_leads`. That’s why you cannot add a company because when you save and exit it is lost again.
That is also why the company contact count is being zero’d.

However my test instance is actually M 6.0.2 and that does not suffer the same problem. You can open a contact with an assigned company, make no changes and save and exit. The company is not removed on a save and exit.

Does this problem still occur on Mautic 6.0.4 onwards ? Would anyone running M6.0.4 or later please confirm if you are experiencing the same problem or has it been fixed already ?

Thanks.

I am on Mautic 6.0.5 or .0.6 in most of my instances and don’t find that bug

Hello rcarabelli,

Thanks for the quick response.

So you can edit a contact that has an assigned company, make no changes and click save and exit and the company is not lost or row deleted from `companies_leads` ?

Did you install M6.0.5 and M6.0.6 directly or did you install interim upgrades ?

I can’t seem to find anything in the version code change logs that comes anything close to this problem on M6.0.3. What version of PHP and Mariadb are you running if you dont mind me asking ?

Thanks.

(post deleted by author)

Hello,

On my production instance (M6.0.3) if I create a new contact and then try to select a pre-existing company I get list of companies with tag “small” before the city and after the country.

However the list does not include all the companies in the database. It stops way short.

If I type the first few letters of the company I get some company names without “small” wrapping city and country. If I select one of those they are not saved when I click save and edit. Only companies with the “small” tags can be saved in the company field.

And looking at the database I cant see the “small” tag anywhere in the company table?

Therefore Mautic must be loading and building the company list but it does not build and display all companies in the database but only a subset. How do you select one that is not in the list ? And if an import adds more companies that do not get a “small” tag they are not viable in the company field and hence the company contact count is zero

My company not being wrapped with “small” is the root problem.

Does anyone know why this is happening on M6.0.3 ?

Thanks

Hello,

I have patched my production instance of M6.0.3 with the following M6.0.4 patch:

I can now add any company stored in the database to a contact and it is preserved when you save and exit from the contact record. The company contact total is as expected.

However the presented company list is still only a subset of the complete list of companies again wrapped by the “small” tag. By typing the company name you want you can add it to the company field and it is preserved on save and exit. These are not wrapped by the “small” tag.

I don’t understand why some companies are wrapped in the “small” tag and others are not. If a developer knows the answer I would like to understand the logic of having two types of company definition in the list.

The next time I import some companies and contacts I will confirm this patch works as expected and I will report the results back here soon.

Thanks.