diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5fb9ffd77..7fd77e27b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - Enabled better month and year navigation in the YUI date picker. (Tom Beharrell) - fixed: Add the user's first day of week data to getWebguiProperties and get rid of some inline javascript in the Data and DateTime forms. - fixed #10544: AssetVersioning: child assets versions under uncommitted parent + - fixed #10549: EMS import 7.7.11 - Fixed a bug where empty version tags were not deleted. (Martin Kamerbeek / Oqapi) diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 1944cbb0d..2f3b59c9f 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -33,7 +33,7 @@ use WebGUI::International; use WebGUI::Utility; use WebGUI::Workflow::Instance; use Tie::IxHash; - +use Data::Dumper; #------------------------------------------------------------------- @@ -1552,7 +1552,7 @@ $|=1; my $first = 1; if (open my $file, "<", $storage->getPath($filename)) { $out->print("Processing file...\n",1); - while (my $line = <$file>) { + ROW: while (my $line = <$file>) { if ($first) { $first = 0; if ($ignoreFirst) { @@ -1581,11 +1581,20 @@ $|=1; next unless isIn($field->{name}, @import); $out->print("\tAdding field ".$field->{label}."\n",1); my $type = $field->{type}; + ##Force the use of Form::DateTime and MySQL Format + if ($field->{name} eq 'startDate') { + $type = 'dateTime'; + $field->{defaultValue} = '1999-05-24 17:30:00'; + } my $value = $validate->$type({ name => $field->{name}, defaultValue => $field->{defaultValue}, options => $field->{options}, },$row[$i]); + if ($field->{name} eq 'startDate' && !$value) { + $out->print('Skipping event on line '.$line.' due to bad date format'); + next ROW; + } if ($field->{isMeta}) { $metadata->{$field->{label}} = $value; }