summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoshe weitzman2010-10-29 04:22:10 (GMT)
committer moshe weitzman2010-10-29 04:22:10 (GMT)
commitb14ba1961a32a2df9f6d1addc3313d92939a93e8 (patch)
tree7fc41a915e9bf784221d23c252660487b3fe4cad
parent3b7ece73e2e0e20e07b765d76096c2783cda631d (diff)
Don't use URL to get XML file since thats not too reliable working through drush. Use file path instead ... Fix for directory creation in Field plugin
-rw-r--r--migrate_example/wine.inc3
-rw-r--r--plugins/destinations/fields.inc2
2 files changed, 3 insertions, 2 deletions
diff --git a/migrate_example/wine.inc b/migrate_example/wine.inc
index 45ef6ba..5272df5 100644
--- a/migrate_example/wine.inc
+++ b/migrate_example/wine.inc
@@ -323,7 +323,8 @@ class WineProducerXMLMigration extends XMLMigration {
MigrateDestinationNode::getKeySchema()
);
- $xml_folder = url(drupal_get_path('module', 'migrate_example') . '/xml/');
+ // This can also be an URL instead of a file path.
+ $xml_folder = DRUPAL_ROOT . '/' . drupal_get_path('module', 'migrate_example') . '/xml/';
$list_url = $xml_folder . 'index.xml';
// Each ID retrieved from the list URL will be plugged into :id in the
// item URL to fetch the specific objects.
diff --git a/plugins/destinations/fields.inc b/plugins/destinations/fields.inc
index c776b74..cffd625 100644
--- a/plugins/destinations/fields.inc
+++ b/plugins/destinations/fields.inc
@@ -256,7 +256,7 @@ class MigrateFileFieldHandler extends MigrateFieldHandler {
break;
case 'file_move':
// file_move() does a copy then delete which slow. So we implement our own.
- if (file_prepare_directory($destination_dir)) {
+ if (file_prepare_directory($destination_dir, FILE_CREATE_DIRECTORY)) {
if (rename($source->uri, $real_destination_file)) {
$file = clone $source;
$file->fid = NULL;