Bug: Editing a Contact Custom Field Removes Associated Company

Mautic Version: 6.0.3

Summary

When editing a contact in the production instance and adding or updating a value in a custom field, the associated Company value is lost after clicking Save and Close.

The test instance is used only for verifying CSV imports, and those imports work correctly - contacts are properly linked to their companies. The issue only occurs when editing contacts in production.

Steps to Reproduce

1. Import Setup (works fine on both instances):

Import a Company CSV.
Import a Contact CSV linked to companies by company name.
Verify imported data:
Contacts have the correct company association.
Company contact totals match expectations.

2. Production Instance Only:

Edit a contact record.
Add or change a value in a custom field.
Click Save and Close.

Actual Behaviour

After saving, the contact’s Company association is removed.

Expected Behaviour

Editing a contact (even custom fields) should not remove the company association.

Additional Notes

* The same import and linking process works fine in both test and production.
* The problem only occurs during manual contact edits in production.
* The trigger appears to be updating any custom field on a contact.
* This procedure has been used successfully for a while; the issue began recently.

Thanks.

Follow-Up

Over the past month, I’ve been focused on migrating our data into Mautic using CSV imports (under 100 records) via the browser import feature. This approach has worked reliably for several weeks - until the last two imports.

Recently, I’ve started noticing that the Company field is being lost for some contacts when custom fields are modified afterwards. It doesn’t affect every contact, but it impacts a significant proportion of records within an import.

My usage is currently fairly minimal - mostly sending segment emails based on imported data so there haven’t been many other system interactions that could explain this behaviour.

While I have limited experience with Symfony, I’m a C and C++ expert and have done database form coding in C and C++ and this issue feels familiar. In those cases, it often came down to a variable size limitation or a field value being overwritten somewhere in the process - both common causes of data loss in structured records.

I hope the Mautic development team can review this soon. Reliable data integrity is essential - if we can’t trust that saved records remain accurate, it undermines the purpose of using Mautic or any database.

Thanks for your attention and for all the hard work maintaining Mautic.

Follow-Up

For the contacts where the company information disappeared, I tried manually re-entering the data.

You can find the company name in the list, select it, then click Save and Close.

However, when reopening the contact, the Company field remains empty - meaning it can’t be manually fixed.

Despite this issue, I was still able to send segment emails for the imported batch.

Nothing reported in the logs.

Thanks

Follow-up

I’ve checked the database and both the company and lead record data appear to be correct. They are properly linked by their respective ID numbers.

Here’s what I’ve done so far:
* Restarted Apache
* Restarted MariaDB
* Restarted PHP
* Flushed the Mautic cache

After these steps, the company list now correctly calculates the expected number of contacts. Clicking through from the company list also brings me to the appropriate contact record.

However, the Company field within the contact record remains empty, even though the database data is accurate. Additionally, I’m still unable to edit the Company field any changes made are not retained after saving.

For context:

* The company and contact imports work correctly on my test instance.
* On the production instance, some contact records are missing the associated company, and the Company field cannot be edited.

There are no errors in the logs.

Any assistance or guidance on resolving this issue would be greatly appreciated.

Thanks

Follow-up

After performing all the restarts mentioned in my previous post, the company “Number of Contacts” value recalculated correctly.

However, within about fifteen minutes, all of them reverted to zero. Shortly afterward, some contacts were detected again — but not all.

Additionally, I’m still unable to manually edit and save the company field in a contact record when it’s blank.

It seems like I might be hitting some sort of memory or system limit that’s causing this strange behavior.

I cant import any more data until I have a solution.

Any assistance or guidance on how to resolve this issue would be greatly appreciated.

Thanks