Using a CSV-file, I can successfully import multiple files to the same node using Feeds Tamper to explode a string of image paths into an array.

But is there a way to also import the description when parsing a feed?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MegaChriz’s picture

Category: feature » support
Status: Active » Fixed

I don't know how this issue is related to CSV files, but you could use the module Feeds XPath Parser to import the description of a RSS Feed.
If this is not what you meant, you may reopen this issue, but provide more information about what you are trying to achieve in this case, preferably with examples.

ressa’s picture

Version: 7.x-2.0-alpha8 » 7.x-2.x-dev
Component: Miscellaneous » Code
Category: support » task
Status: Fixed » Patch (to be ported)
FileSize
954 bytes

Thanks for taking the time to answer me. This is an example of the CSV file I was trying to import, with the document and description separated with a pipe (|), but didn't work:

Author;Title;Date;Pages;Institution;Document
Joan Smith;Title of the article;1/3-2013;120;UAE;/home/user/docs/attached-document.pdf|Description of the attached document

I found this thread, where importing image alt and title information was added: https://drupal.org/node/1080386

So I have now patched the mappers/file.inc file, adding description for files, and it seems to be working: I get the option of choosing "Document: Description" under the Feeds mappers, and the description is imported.

This is the new format for my CSV file, with the description separated into its own field, which is mapped as Source: "DocumentTitle", Target: "Document: Description":

Author;Title;Date;Pages;Institution;Document;DocumentTitle
Joan Smith;Title of the article;1/3-2013;120;UAE;/home/user/docs/attached-document.pdf;Description of the attached document

Feel free to test the patch :-)

MegaChriz’s picture

Category: task » feature
Status: Patch (to be ported) » Needs review

I set the status of this issue to "needs review" because the "patch (to be ported)" issue status is used for when an already committed patch needs to be ported for an other version/branch of the project. See also http://drupal.org/node/156119 for more information about issue statuses.
The category "task" is generally more used by module maintainers to point what needs to be done to unblock a stable release or to unblock other issues. So I'm changing this to a "feature request". See also http://drupal.org/node/1181250.

As for the patch itself, I haven't followed that other issue closely, so I'm not sure if this is the right way to go. Hopefully, somebody else can review the patch. One minor thing I saw, though, was some extra whitespace at line 16 of the patch. You could check your code for extra whitespace with the Coder module using the "minor (most)" warning level.

ressa’s picture

Thanks for setting the Category and Status to their correct values, I am not so used to submitting patches.

The link to the other issue was more a heads up -- that a similar issue was being debated. The patch above (which actually passed the Simpletest, even with the white-space...?) is based on the solution already in the dev version of the module, where an image title and alt tag can be mapped and imported. All I did was add description for files in the module.

fradipa’s picture

Hi, this is what I need!

Unfortunately I can't apply the patch on feeds 7.x-2.0-alpha8; my terminal freeze... some idea, please?

bisscomm’s picture

delete please

Abelito’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
FileSize
946 bytes

This patch worked great for me, and was exactly what was needed. I'm surprised it hasn't been added to the module, since it is a very basic change.
I updated it to remove the white space.

I reviewed the patch by importing files (with descriptions) into the drupal 7.31 site using a csv file.
- I also tested importing using multiple files into a multifield with Feeds Tamper
- I used the patch on the latest version of Feeds (7.x-2.0-alpha8)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: feeds-add-file-description-2011240-3.patch, failed testing.

Abelito’s picture

I'll try and remake the patch tomorrow.

punch’s picture

Applied the changes in #2/#7 which worked great og the 7.x-2.0-alpha8. This should be added to the module by default.
I tested importing using Feeds XPath Parser module with multiple files and descriptions.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: feeds-add-file-description-2011240-3.patch, failed testing.

  • twistor committed 45152d3 on 7.x-2.x authored by ressa
    Issue #2011240 by ressa, Abelito: How to import the description of a...
twistor’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.