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.
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?
Comment | File | Size | Author |
---|---|---|---|
#7 | feeds-add-file-description-2011240-3.patch | 946 bytes | Abelito |
#2 | feeds-add-file-description-2011240-2.patch | 954 bytes | ressa |
Comments
Comment #1
MegaChriz CreditAttribution: MegaChriz commentedI 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.
Comment #2
ressa CreditAttribution: ressa commentedThanks 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:
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":
Feel free to test the patch :-)
Comment #3
MegaChriz CreditAttribution: MegaChriz commentedI 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.
Comment #4
ressa CreditAttribution: ressa commentedThanks 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.
Comment #5
fradipa CreditAttribution: fradipa commentedHi, 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?
Comment #6
bisscomm CreditAttribution: bisscomm commenteddelete please
Comment #7
Abelito CreditAttribution: Abelito commentedThis 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)
Comment #9
Abelito CreditAttribution: Abelito commentedI'll try and remake the patch tomorrow.
Comment #10
punch CreditAttribution: punch commentedApplied 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.
Comment #14
twistor CreditAttribution: twistor commented