1

I am using migration to import nodes from a csv. I want to change the file name when import is done. How can I call a custom function when Import/Migration is done from a specific file to change its name?

I knwo about the postimpot but I am looping thorugh directories to import data from each csv file in each directory. So postimport is called every time a file has been imported. But in posImport I cant use argument to change the last imported file name only.

1 Answer 1

0

use a static variable in postimport to do a check that you're on the last folder or task or the import, there has to be some value you can track. You could even set a variable of all the csv files to do (in-order) within your migration class -- and check which file you're on in postimport.

1
  • Even I saw your answer after I am done with issue, I did the same thing u mentioned here. Using variable. Thanks :) Commented Jul 3, 2014 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.