Your software
My Mautic version is: v2.16.0
My PHP version is: 7.2.27
Custom field limit
My problem is: to add custom fields i have to add mare then 200 custom field and when i reached to 110 it give error that (You have reached the limit of custom field allowed in your database)
Mautic creates additional custom fields as columns in the leads table, and MySQL imposes a limit on how many columns or bytes of data there can be in a particular row. Wonder if upgrading to MySQL 8.0 from MySQL 5.7 would expand the number of columns possible.
There is an extended field plugin that is mentioned in this linked issue, which may help for your particular use case.
We’re exploring Mautic as a solution and would also require a fair amount of custom fields for our purposes. Have you tried the plugin that was mentioned and did you have success with it?
For the first time in years I have hit this error. It is super strange as I have many instances of Mautic installed with way more fields I am trying to do at the moment.
Anyone know of a good workaround here, I am hitting the same problem with an installation of 4.1.0.
Also I have tried the extension however I am not sure it is compatable with 4.1.0 as after installing it was unable to create any new fields or edit old fields
I came accross this problem today and the extended fields plugin doesn’t work properly with 4.1. anymore.
Also I needed a specific action which was introduced in Mautic 4.1 - send email to user with token support. This is not possible if the token would be one from the extended fields plugin - because the token alias gets looked up inside the “lead” table and not inside “lead fields” table.
Anyway.
I took a deeper look into the actual problem in the database:
Text fields get inserted into the database as “varchar” and the character number -
system fields are defined as varchar with 191 characters
new text customfields are varchar with 255 characters
The mysql limitation is that a table can not exceed 65,535-byte row size.
This means you can create as many fields until you hit the 65,535-bytes.
Therefor you can:
change the varchar characters to the actually needed size:
(i.e if you only need the words red or blue you could limit the characters to 4 - because blue has only 4 characters)
or you change the fields to text instead of varchar - but this makes them non-indexable - means the search for something in the database gets a lot slower.
I changed most of my fields to a varchar character value of 99 or 49
after i did that with almost 100 fields I was able to insert all the other fields I needed
As @mikew described you could just use the “alter table” sql to change a field.
The easiest way would be to simply open the database in phpmyadmin or adminer > navigate to the table lead_fields and change the values there.