I am working on creating an event calendar and therefore I created a custom module to save events in custom content type. I have already installed the entity module and the date module.
I have created a date field & # 39; partner_event_date & # 39; that accepts values from and to date.
In my custom module, I am adjusting the values of the date field as shown below:
$ wrapper-> field_partner_event_date-> set (array (
& # 39; value & # 39; => date (& # 39; Y-m-d H: i: s & # 39 ;, $ dateFrom),
& # 39; value2 & # 39; => date (& # 39; Y-m-d H: i: s & # 39 ;, $ dateTo),
And an output is displayed at the top of the screen:
array (& # 39; value & # 39; => & # 39; 2022-02-05 00: 00: 00 & # 39 ;, & # 39; value2 & # 39; => & # 39; 2024-07-03 00 : 00: 00 & # 39 ;,)
The error I get is:
EntityMetadataWrapperException: Invalid data value given. Make sure it matches the required data type and format. Value in node () -> field_partner_event_date :. in EntityMetadataWrapper-> set () (line 122 of /sites/all/modules/entity/includes/entity.wrapper.inc).
I installed my module in a new drupal installation, there it is working absolutely fine, but on the client site (which is already built) when I installed and configured it, then these errors are popping up. Can anyone help with this.