From 86741d5135f92ac0a4bcc3d8d8f562c691976612 Mon Sep 17 00:00:00 2001 From: Tim Baumgard Date: Tue, 14 Feb 2017 19:10:43 -0600 Subject: [PATCH 8/9] Changed the example content installer to use a full path so that Drupal doesn't use a random file name --- modules/ad_ui/ad_ui.drush.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ad_ui/ad_ui.drush.inc b/modules/ad_ui/ad_ui.drush.inc index 4828fcc..bdfa7aa 100644 --- a/modules/ad_ui/ad_ui.drush.inc +++ b/modules/ad_ui/ad_ui.drush.inc @@ -131,6 +131,7 @@ function _ad_ui_install_ads() { foreach ($ad as $image => $destination) { $n++; $image_path = drupal_get_path('module', 'ad_ui') . '/images/' . $image; + $image_dest = "{$target_dir}/{$image}"; $ad = entity_create('node', array( 'type' => 'ad', 'status' => 1, @@ -138,7 +139,7 @@ function _ad_ui_install_ads() { 'changed' => REQUEST_TIME, 'uid' => 1, 'title' => $size . ' ' . $n, - 'field_ad_image' => array(LANGUAGE_NONE => array((array) file_save_data(file_get_contents($image_path), $target_dir))), + 'field_ad_image' => array(LANGUAGE_NONE => array((array) file_save_data(file_get_contents($image_path), $image_dest))), 'field_ad_link' => array(LANGUAGE_NONE => array(array('url' => $destination))), 'field_ad_size' => array(LANGUAGE_NONE => array(array('tid' => $term->tid))), ) -- 2.11.1