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.
Ok So I am trying to import nodes with remote file export method but somehow URLS in var export are not correct. This is what it looks like
Could not open 'http://croaziadentisti.it/public%3A//zub1.png' for reading.
seems like "files" directrory variables is not passed like it should be and instead some "public%3A/" token is here and ofcourse it doesn't work then. Any ideas why this is so?
Comment | File | Size | Author |
---|---|---|---|
#5 | patch_export_remote_files_to_handle_uri_2046431.patch | 640 bytes | m4olivei |
Comments
Comment #1
markosef CreditAttribution: markosef commentedThis is export data excerpt
and file_default_scheme() function also gives public:/ if checked in node_export.module around
I checked this at two locations one is the drupal ugprade from 6 to 7, other is a multisite setting, both drupal sites work fine but are a bit complex.
Anyway. What I did is a hack to fix this as I counldn't locate where does problem come from. I rewrote how file path is constructed with one line and it works now.
So maybe this could help someone. Also suggestion to module maintainter to add a "default" variable for path when exporting, this could solve possible cases like this if someone else has the same problem. But then again maybe it is a bug for everyone :-)
Comment #2
im0000 CreditAttribution: im0000 commentedThanks, it works for me, and I found a better way
Comment #3
markosef CreditAttribution: markosef commentedIt is better when using multisite. :)
Comment #4
Jaggi CreditAttribution: Jaggi commentedI preferred to do it this way as its much cleaner and does the same job:
Also this is a bug as the url will always have public:// stream and the url method doesn't handle this type of url.
Comment #5
m4olivei#4 worked for me, and IMO is the most correct way to do it. I'm attaching a patch against 7.x-3.0.
For those using the Drush command to export their nodes as I am, I also found that you need to use the
--uri
command line param to have the correct URL generated for the remote file export method, eg:Comment #6
m4oliveiComment #7
Maxime Gilbert CreditAttribution: Maxime Gilbert commentedThis works like a charm: must be released.
Comment #8
Marko B CreditAttribution: Marko B commentedThis seem to work, even on multisite, good job.
Comment #9
JMC CreditAttribution: JMC commentedPatch #5 worked for me, thanks.
Comment #10
camp5456 CreditAttribution: camp5456 commented#5 worked for me. Thanks!
Comment #12
danielb CreditAttribution: danielb commented