Hello Experts..

I am developing installer profile in Drupal 6 , i want to import my CCK's from the text file

i have tried this code but its not working for me,


  include_once('./'. drupal_get_path('module', 'node') .'/content_types.inc'); 
  include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc');

  $values = array();
  $values['type_name'] ='<create>';
  $values['macro'] = implode("\n", file(dirname(__file__)."/cck_import.txt"));
  drupal_execute("content_copy_import_form", $values);

so please help me....

Comments

chris_lu’s picture

Try the fallowing:

  include_once('./'. drupal_get_path('module', 'node') .'/content_types.inc'); 
  include_once('./'. drupal_get_path('module', 'content') .'/includes/content.admin.inc');

  $values = array();
  $values['type_name'] ='<create>';
  $values['macro'] = implode("\n", file(dirname(__file__)."/cck_import.txt"));

  $form_state = array();
  $form_state['values'] = $values;
  drupal_execute("content_copy_import_form", $form_state);
Kuldip Gohil’s picture

hi chris,

thanks for the reply

i am getting following warning while using above code

* warning: Missing argument 2 for drupal_retrieve_form() in /var/www/d6/includes/form.inc on line 318.
* warning: Missing argument 3 for drupal_process_form(), called in /var/www/d6/includes/form.inc on line 295 and defined in /var/www/d6/includes/form.inc on line 389.