Hi All,
This is an update on the current status of the problem. With version 8.3.5 issue problem no longer occurs.
yuri Thank you.
THIS TOPIC IS NOW CLOSED.
What is this WARNING: E_WARNING: Undefined array key "maxLength"
Collapse
X
-
Hi shalmaxb sorry for the late reply. I do not have any formula or optional conditions set. Just plain simple enum. -
shalmaxb hi,
Thank you for responding. I did as you advised and i still get the warning. This is testnum i created which has no blank option and default is set correctly (see screencap below):
Leave a comment:
-
You have one empty option in your enum and that is configured to be default. I guess the error would go, if you either delete the empty option or refer default to another option.Leave a comment:
-
Looks like there is solutions to this. Did anyone else get this problem?Leave a comment:
-
-
@item
(1) If you a upgrading from version 8.1.5, the existing enums do not have the "maxLength" and they do not produce this warnings. But if you create a new enum, the "maxLength" parameter appears and the warning will be logged.
(2) The warnings appear only when we create or customize the enum field not when when the user uses them in the form. Yet i am still concerned because, as this is a PHP warning, i am not sure if later it may cause some other fatal issues. I would want to get rid of the problem before going into production mode.
(3) My PHP Version is 8.1.12. Once i complete my re-engineering i will migrate them to PHP 8.2.x.
(4) as you stated "...certainly before or after Yuri have make this params" I am not sure if there was any indication in any of the releases where this enhancement is mentioned or explained. I will check again, i could have missed it.Last edited by murugappan; 05-03-2024, 04:48 AM. -
Hi murugappan,
now you have give a "full helping info" .. but it's out of my knowledge now
maybe have you a different php version ?
when i say entityDefs, it's the entityDefs where you have this field.
I have to see "maxLength" to my instance.. somewhere, and not somewhere.. certainly before or after Yuri have make this params.
I have some enum field without this params, with this params and not warning. (i use last php version always) -
item victor
Thank you for responding.
(1) I know about the custom prefix and i set that to 'true' in config.php because i do not want the prefix as i already have the c_ prefix.
(2) entityDefs.json? Which one and where?
(3) I do not have any validation rules for these fields.
add : "maxLength": 100 to field enum in entityDefs
Additional Notes:
(1) In the case where i upgraded, the problem des not exist when i change existing enum fields, it only happens when i add a new enum field. I upgraded from 8.1.5. Version 8.1.5 does not have this problem.
(2) I tried multiple fresh installation from 8.2.0 to 8.2.3 and all of them have the same problem.
Latest Update (2024-05-01)
I did some further debugging. I compared the Custom->metadata->entitDef-><entity> for version 8.1.5 and 8.2.3. I found that the enum definition for 8.2.3 has the "maxLength" parameter for enum fields (s ee screencap below). In 8.1.5 this parameter is not there. So i removed the parameter in 8.2.3 and the warning disappeared. I may found the cause but not the solution. I am sorry I do not have the technical knowledge of espocrm code.
Last edited by murugappan; 05-01-2024, 10:44 AM.Leave a comment:
-
Hi,
espocrm v8.2 added custom prefix.. https://github.com/espocrm/espocrm/issues/2988
what is your config.php ? a copy from one old instance ?
what is your entityDefs.json ?
have you validation rules for this field ?
add : "maxLength": 100 to field enum in entityDefs..
Leave a comment:
-
victor
Unfortunately, this is not true in my case. All the enums have options defined (see below). I did the same in version 8.1.5 and there were no problems. In version 8.1.5 i could save an empty enum and it will still work.
Last edited by murugappan; 04-30-2024, 03:51 AM.Leave a comment:
-
victor
The Debug log below:
espo-2024-04-29.log.zip
I did some debugging tests and what i found was that it only happens when we create a fresh instance of espocrm using version 8.2.2 or 8.2.3 (not sure about 8.2.0 and 8.2.1). It does not happen when i save enums in instances which were upgraded from versions < 8.2.0Attached FilesLast edited by murugappan; 04-29-2024, 10:51 PM.Leave a comment:
Leave a comment: