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.
invalid date format
Date database inserts should only happen if the returned DateObject is valid.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Simon Peacock created an issue. See original summary.

Simon Peacock’s picture

Simon Peacock’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: feeds-only-insert-valid-date-2861486-1.patch, failed testing.

MegaChriz’s picture

Status: Needs work » Postponed (maintainer needs more info)

@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:

  • The source file you were trying to import (may also be a sample file, as long as that sample file can demonstrate the problem).
  • An export of your configuration, packed inside a feature module, which includes:
    • Your Feeds importer
    • Feeds Tamper configuration
    • The content type selected on the processor
    • Field bases of fields used on your content type
    • Field instances of your content type
    • Strongarm variables belonging to your content type (install the Strongarm module to make them available).
    • Eventually other exportable configuration that is related.
Simon Peacock’s picture

FileSize
1.6 KB

@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:

  • drush make build-drupal-test-site.make drupal_test_site
  • cd drupal_test_site/
  • drush si drupal_test_profile -y --site-name="Test Event Import" --account-name=admin --account-pass=123 --db-url=mysql://root:123@localhost/drupal_test_site (replace database data as appropriate)
  • Go to {site-name}/import and import the attached csv file

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

butterwise’s picture

Subscribing; 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"'.

MegaChriz’s picture

@butterwise
So the beta2 handles importing 'all day' correctly, but later versions don't?