Hi,

When I try to import an XML-file that contains dates, that sometimes can be empty, the tamper called "String to Unix timestamp" causes an error when the field is empty.

Is there anyway to prevent this?

Comments

Patrick Danielsson created an issue. See original summary.

Anilu@’s picture

I experience the same issue on a new Drupal 10 installation with Feeds Tamper 2.0@beta

I was able to sort this issue by using a rewrite plugin on top of "String to Unix timestamp." I used a token on the rewrite so I can use another field as default value. You can also use a "Set value or default value." Detail in https://www.drupal.org/project/feeds_tamper/issues/3029164

Them I set a conditional on the template so it does not render the default value.

Is not a full solutions but I work for now.

Anilu@’s picture

Version: 7.x-1.1 » 8.x-2.x-dev
Status: Active » Needs work
Issue tags: +Needs work, +Drupal 10
Anilu@’s picture

Ticket needs update

ericgsmith’s picture

Adding related issue. I feel like this probably could also be moved to the tamper issue queue if this is not specific to feeds tamper.

Thank you for sharing your work around analaura!

besek’s picture

Title: Emtpy value causes error on "String to Unix timestamp" » Empty value causes error on "String to Unix timestamp"
besek’s picture

This fix from Tamper module:
https://www.drupal.org/project/tamper/issues/3119301
might be good solution. It provides new tamper "Skip tampers on empty". I've added this tamper to every field that I'm trying to manipulate and it works fine