I'm working on creating a calendar event, so I've created a custom event storage module for a custom content type. I installed the entity and date modules and created a date field (partner_event_date) that accepts values from and up to the date.
In my custom module I use the following code.
$wrapper->field_partner_event_date->set(array( 'value' => date('Y-m-d H:i:s',$dateFrom), 'value2' => date('Y-m-d H:i:s', $dateTo), ));
The following output is displayed at the top of the screen.
array( 'value' => '2022-02-05 00:00:00', 'value2' => '2024-07-03 00:00:00', )
The error I get is the following.
EntityMetadataWrapperException: Invalid data value specified. Make sure it matches the required data type and format. Value at node () -> field_partner_event_date:. in EntityMetadataWrapper-> set () (line 122 of /sites/all/modules/entity/includes/entity.wrapper.inc).
I installed my module on a new Drupal installation. It works fine while the client site (which has already been created) displays this error message during installation and configuration. Can anyone help?