Hi,

I banging my head for some days to import data from an XML file to nodes. I'm using "Feeds XPath Parser" for this. It works like a charm and I have no problems when data is correctly specified inside the XML.

For testing I setup a content-type with some required text fields. When I import the data from the XML and one of the required fields is empty the node will be created. This happens also, if the title is empty.

I tested this also with 6.x-1.x-dev and other Parses (RSS, CSV) and the result is the same.

So my general question is: How are required fields handled?

If there is no way to rely on the parser or processor for such checks, then I will start and get my data right, that there are no empty values for required fields. But maybe I missed something in the documentation?!

It would be nice if anyone can give me a hint for that!

Best regards, Tom

Comments

scotjam’s picture

Hi Tom,

Did you find an answer to your question on how to deal with required fields on import?

I'm looking to address the same issue.

cheers
scotjam

TomMynd’s picture

Hi,

no... currently I do this step before saving / creating the XML for the import so that there are no required fields missing.

Best regards, Tom

scotjam’s picture

Is there any reason why the node rules are not applied?

Seem a bit weird to me! I wonder if Feeds Tamper or Rules or Views Bulk Operations could assist here.

cheers

TomMynd’s picture

Good point. I hoped to get an answer here. I've got to this problem when using Feeds XPath Parser in combination with Feeds Image Grabber.

I had an XML-file with links to images in the wild and a content type, that should be used to save these images inside an imagefield. Sometimes the download of the image failed, but the node was created without the image during import. The imagefield was a required field for that content type. So after looking at the code of "Image Grabber" I thought it would be better to ask this question here.

Best regards, Tom

scotjam’s picture

Category: support » feature

Don't think this is possible at the moment, so changing it to a feature request, hope that's okay!

twistor’s picture

I added a plugin to feeds_tamper that will stop a feed item from being saved if the selected field is empty. Hope this helps.

http://drupal.org/cvs?commit=490648

scotjam’s picture

Brilliant! Thank you!

danepowell’s picture

Version: 6.x-1.0-beta10 » 7.x-2.x-dev

I'm not sure if this should be a bug report or feature request- but it definitely seems that required fields are not respected in Feeds 7.x-2.x.

franz’s picture

Status: Active » Closed (works as designed)

They are supposed to be that way. If you need the functionality, Feeds Tamper provides it.

tistou’s picture

Issue summary: View changes

twistor,
Could you please tell which of the feed temper options allows me to stop node from being saved if the field is empty?
Thank you,

I added a plugin to feeds_tamper that will stop a feed item from being saved if the selected field is empty. Hope this helps.