2

Posted this here as well http://drupal.org/node/1943324

I am trying to migrate multi-value file-fields. I checked out the wine.inc but the sample provided doesn't work for me. I tried to use JSON-encoded arrays that didn't work either and i read somewhere that method is now obsolete.

How to do this?

Here's what i have:

$this->addFieldMapping('field_case_file_upload', 'file_upload_url'); $this->addFieldMapping('field_case_file_upload:description', 'file_upload_title'); $this->addFieldMapping('field_case_file_upload:destination_dir') ->defaultValue('public://pdfs/sun_files');

    public function prepareRow($current_row) {
        $result = db_select('tbl_myfiles', 'f')
                  ->fields('f', array('file_upload_url', 'file_upload_filepath', 'file_upload_title'))
                  ->condition('content_id',$current_row->content_id)
                  ->condition('f.file_upload_url', '%pdf%', 'LIKE')
                  ->execute();
        foreach ($result as $row) {
              $current_row->file_upload_url[] = $row->file_upload_url;
              $current_row->file_upload_filepath[] = $row->file_upload_filepath;
              $current_row->file_upload_title[] = $row->file_upload_title;
        return TRUE;
         }  
           }

I am sure im not doing something right. Can someone cool please point me in the right direction? :)

I have tried the solution provided here but still can't get the file_descripton in Migrating files with descriptions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.