File target: add support for local file path as source

Created on 2 May 2018, over 6 years ago
Updated 3 August 2024, 4 months ago

Current issue

The Drupal 7 version of feeds had support for importing local files. Drupal 8+ Feeds currently only supports importing by URL. Let's add support for local files to the Drupal 8+ version, too.

Original issue:

Hi,

For file field, there is option to give only fields from file entity. Is It possible to give file URL. I have a use case to import content with file url.

How I can do it?

Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

🇮🇳India saranya ashokkumar

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    701 pass
  • 🇨🇦Canada yang_yi_cn

    Rebased again to bring up upstream changes, so the patch can apply.

    The patch is available at https://git.drupalcode.org/project/feeds/-/merge_requests/28.patch, but I'm saving a static copy here as well.

  • Still seems to be an issue with Drupal 10. How do I use the feeds module to import feeds with images from a ../private/ directory? I have tried private://image.jpg and I get:

    cURL error 1: Protocol "private" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for private://image.jpg

  • 🇿🇦South Africa niki v

    Still an issue with D10 and commerce imports
    I'm working locally and views data export only gives local file paths, so I downloaded all the images and placed them in the folders that matched the csv structure. The import fails with cURL error 3 but succeeds if image field is not required and I leave it out of the import.

    I guess I'll be editing my csv files or is there another way to add the local file path?

  • Assigned to RohitRawat676
  • Status changed to Active about 1 year ago
  • 🇮🇳India RohitRawat676

    fixing some codeing standard

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    708 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update 6 months ago
    717 pass
  • Pipeline finished with Failed
    6 months ago
    Total: 1012s
    #169893
  • Thank you for a great module, which has been my go-to for years now. I am currently converting a site from D7 to D10 and really need to be able to import local files using the public:// path. Neither the patch in #45 nor the merge request will apply in Drupal 10.3.1. Any chance of an update?

  • 🇳🇱Netherlands megachriz

    @tsurvuli
    Hm, perhaps if you need this quickly, could you try the patch/code applied on Feeds 8.x-3.0-beta4 instead? Biggest things that you'll miss is the possibility to skip entity validation and importing users with roles (a change in Drupal 10.2 broke role import for Feeds 8.x-3.0-beta4).

    All my focus is on getting Feeds (and some modules that extend Feeds) ready for Drupal 11.

  • 🇺🇸United States SocialNicheGuru

    @tsurvuli please try the patch in #41. It does apply to Drupal 10.3.1

    I have no idea why the patch in #45 was placed in this issue.
    @rohit.rawat619 could you open up another issue and place your patch there. It is not germain to this issue.

  • 🇳🇱Netherlands megachriz

    @SocialNicheGuru
    Looking at the patch in #45 now, I see it is indeed only coding standard fixes. There's no need to open a new issue for that. Except a few that are explicitly ignored, all coding standard issues have been fixed.

  • @SocialNicheGuru, for what it's worth I was able to successfully apply the patch in #41, but only after I removed the patch from issue 2928904 Add a mapping target to media field Needs review , which I had already added. For some reason, if either patch is present in the composer file, the other won't apply. Right now I have 2928904's patch in my composer file. (And I have the beta4 version of Feeds.)

    Since I am trying to create both a series of media importers that will import files as media, and also a node importer that will then import those local media files into node content, it would be extremely helpful if both patches were available to use at the same time. Thanks for the quick responses from you and @MegaCriz.

  • that's what happens when waiting for 7 years before merging patches

  • Status changed to Needs work 4 months ago
  • 🇯🇵Japan ptmkenny

    The status is incorrect; this is not ready for review. It still needs tests (#31) and there are the issues I pointed out in #33 and #34.

Production build 0.71.5 2024