Commit 7f32dfd5 authored by acrollet's avatar acrollet

Fix unit method invocation

parent 98ae1564
...@@ -247,9 +247,10 @@ class UpdateAvailabilityForm extends FormBase { ...@@ -247,9 +247,10 @@ class UpdateAvailabilityForm extends FormBase {
} }
foreach ($booked_units as $unit) { foreach ($booked_units as $unit) {
$bat_unit = bat_unit_load($unit);
drupal_set_message(t('Could not create event from @start to @end for unit @label with ID: @unit', [ drupal_set_message(t('Could not create event from @start to @end for unit @label with ID: @unit', [
'@unit' => $unit, '@unit' => $unit,
'@label' => $unit->label(), '@label' => $bat_unit->label(),
'@start' => $start_date->format('Y-m-d'), '@start' => $start_date->format('Y-m-d'),
'@end' => $end_date->format('Y-m-d'), '@end' => $end_date->format('Y-m-d'),
]), 'warning'); ]), 'warning');
...@@ -292,9 +293,10 @@ class UpdateAvailabilityForm extends FormBase { ...@@ -292,9 +293,10 @@ class UpdateAvailabilityForm extends FormBase {
} }
foreach ($booked_units as $unit) { foreach ($booked_units as $unit) {
$bat_unit = bat_unit_load($unit);
drupal_set_message(t('Could not create event from @start to @end for unit @label with ID: @unit', [ drupal_set_message(t('Could not create event from @start to @end for unit @label with ID: @unit', [
'@unit' => $unit, '@unit' => $unit,
'@label' => $unit->label(), '@label' => $bat_unit->label(),
'@start' => $start_date->format('Y-m-d'), '@start' => $start_date->format('Y-m-d'),
'@end' => $end_date->format('Y-m-d'), '@end' => $end_date->format('Y-m-d'),
]), 'warning'); ]), 'warning');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment