Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a date field is empty on a CSV import the updated Feed Data Mapper now attempts to insert an empty string into the database and breaks the feed import. This is also the case if the dateObject returned contains errors.
Date database inserts should only happen if the returned DateObject is valid.
Comment | File | Size | Author |
---|---|---|---|
#6 | test_import_date.zip | 1.6 KB | Simon Peacock |
#2 | feeds-only-insert-valid-date-2861486-1.patch | 1.24 KB | Simon Peacock |
invalid_date_format.png | 25.65 KB | Simon Peacock |
Comments
Comment #2
Simon Peacock CreditAttribution: Simon Peacock commentedComment #3
Simon Peacock CreditAttribution: Simon Peacock commentedComment #5
MegaChriz CreditAttribution: MegaChriz at WebCoo commented@Simon Peacock
Can you check if this is still an issue with the latest dev?
Also, for reproducing the issue it would be helpful if you provide an export of your configuration + a sample of the feed you are importing.
Can you provide the following:
Comment #6
Simon Peacock CreditAttribution: Simon Peacock commented@MegaChriz
Hi - thanks fo the follow up.
I can confirm that this issue is fixed in the 2.x-dev branch. The empty string has been replaced will a Null and so the sql insert no longer fails.
As requested I have attached a zip containing a make file that will enable you to replicate the issue on the 2.0-beta3 branch, and a csv file for importing.
Once the make file has been downloaded run the following commands:
The import will fail on the three items that do not have an end date.
I am not going to currently use the dev branch but will be happy to use a local patch on 2.0-beta3 to fix this on our prod sites.
Happy for you to close this issue if you feel that ok?
Cheers
Comment #7
butterwise CreditAttribution: butterwise commentedSubscribing; we're stuck on 7.x-2.0-beta2 since we import events which sometimes occur 'all day' and thus have no end date, per say. But, we need to move up to beta-3 or -4, which include 'fixed invoking rules events "feeds_before_import" and "feeds_after_import"'.
Comment #8
MegaChriz CreditAttribution: MegaChriz at WebCoo commented@butterwise
So the beta2 handles importing 'all day' correctly, but later versions don't?