Fix for Fix for Fix for Image Field Import

  1. if ($row['avatar']) {
  2.         $path = 'files/old/joomla/images/comprofiler/' . $row['avatar'];
  3.         $temp_image = field_file_save_file($path);
  4.         $temp_image['status'] = FILE_STATUS_PERMANENT;
  5.         $temp_image['list'] = 1;
  6.         $temp_image['uid'] = $account->uid;
  7.         $temp_image['data'] = array ('description' => '', 'alt' => ' ', 'title' =>
  8.  '');
  9.         $node_profile->field_sw_usrp_image[0] = $temp_image;
  10.  
  11.       print_r($node_profile);
  12.       die();
  13.       }
  14. =====
  15. RESULT
  16.     [field_sw_usrp_image] => Array
  17.         (
  18.             [0] => Array
  19.                 (
  20.                     [uid] => 25
  21.                     [filename] => 64_4596f0db87b1f_0.jpg
  22.                     [filepath] => /tmp/64_4596f0db87b1f_0.jpg
  23.                     [filemime] => image/jpeg
  24.                     [source] => field_file_save_file
  25.                     [destination] => /tmp/64_4596f0db87b1f_0.jpg
  26.                     [filesize] => 40293
  27.                     [status] => 1
  28.                     [timestamp] => 1260444334
  29.                     [fid] => 133
  30.                     [list] => 1
  31.                     [data] => Array
  32.                         (
  33.                             [description] =>
  34.                             [alt] =>  
  35.                             [title] =>
  36.                         )
  37.  
  38.                 )
  39.  
  40.         )

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.