- 🇮🇹Italy afagioli Rome
No more support for BAT on Drupal 7.
Latest BAT for Drupal 10 has most of the bugs fixed.
Consider upgrading.
Hi,
The granularity of event type is "per hour".
This error occurs when a hour is not completed :
TypeError : DateTime::__construct() expects parameter 1 to be string, array given dans DateTime->__construct() (line 449 on /sites/all/modules/bat/modules/bat_event/bat_event.admin.inc).
To fix it, I changed the file "bat_event.admin.inc" like that :
function bat_event_edit_form_validate(&$form, &$form_state) {
// Notify field widgets to validate their data.
entity_form_field_validate('bat_event', $form, $form_state);
$event_type = bat_event_type_load($form_state['values']['type']);
$target_field_name = 'event_' . $event_type->target_entity_type . '_reference';
if ($event_type->fixed_event_states) {
- if ($form_state['values']['bat_start_date'] != '' && $form_state['values']['bat_end_date'] != '' &&
- $form_state['values'][$target_field_name][LANGUAGE_NONE][0]['target_id'] != '') {
+ if ($form_state['values']['bat_start_date'] != '' && is_string($form_state['values']['bat_start_date'])
+ && $form_state['values']['bat_end_date'] != '' && is_string($form_state['values']['bat_end_date'])
+ && $form_state['values'][$target_field_name][LANGUAGE_NONE][0]['target_id'] != '') {
global $databases;
$prefix = (isset($databases['default']['default']['prefix'])) ? $databases['default']['default']['prefix'] : '';
$event_store = new DrupalDBStore($event_type->type, DrupalDBStore::BAT_EVENT, $prefix);
$start_date = new DateTime($form_state['values']['bat_start_date']);
$end_date = new DateTime($form_state['values']['bat_end_date']);
$end_date->sub(new DateInterval('PT1M'));
It's not need to validate the form in 'bat_event" module because the validation of the date has already failed.
Regards,
Detroz
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No more support for BAT on Drupal 7.
Latest BAT for Drupal 10 has most of the bugs fixed.
Consider upgrading.