Project:Wordpress Import
Version:6.x-2.x-dev
Component:Code
Category:task
Priority:normal
Assigned:lavamind
Status:closed (duplicate)

Issue Summary

in line 605 of wordpress_import.module
include this to alias the files/images location

  $thepath = url(file_directory_path());
  $subpath = "/images";
  $myURL = $thepath . $subpath;
  $content = str_replace('/wp-content/uploads', $myURL , $content);

then copy the whole folder of wp-content/uploads from wordpress folder to drupal file directory path (e.g. sites/all/default/)

AttachmentSize
wordpress_import.zip7.28 KB

Comments

#1

Assigned to:walktalker» Anonymous

#2

I'm not so superb about webserver > webserver file transfer. could anyone include this in the module?

#3

Status:active» needs work

Hi walktalker,

Thanks for your interest in wordpress import.

Your code is a nice workaround, but I'm afraid it isn't robust enough to be integrated into the module. If a post contains the phrase "Wordpress stores its files in the directory /wp-content/uploads", it will be replaced by "Wordpress stores its files in the directory /sites/example/files/images". Furthermore, I think a better approach would be to create a customisable filter, so that the original content won't be changed and we will be able to support special cases, for example a drupal installed in a subdirectory.

#4

I agree with you. I never think to write a module would be that hard... ^.^
Anyway, this is my 1st trial to work around a module. I'd need to learn more about creating a form to gather more var.

#5

Version:6.x-1.x-dev» 6.x-2.x-dev
Assigned to:Anonymous» lavamind
Status:needs work» active

Fetching post images is implemented using cURL in 6.x-2.x-dev, removing need to manually transfer files. However, other types of content aren't transferred, though a similar approach could eventually be used for attachements.

#6

Status:active» closed (duplicate)

Marking duplicate of #206749: Add attachments support

nobody click here