0

i try to create custom import csv file module in drupal 6. but i received this error

warning: Missing argument 2 for module_name_import_form() in C:\xampp5.6\htdocs\hafizu97\sites\all\modules\module_name\module_name.module on line 24.
import

i've try to change db_query but still i got this error message. here my code

function module_name_import_form($form, $form_state) {
    $form['notes'] = array(
        '#type' => 'markup',
        '#markup' => '<div class="import-notes">A few upload fiel. <ul><li>pastikan file berformat .csv</ul></li></div>',
        '#upload_location' => 'public://tmp/',
        );
    $form['import'] = array(
        '#title' => t('import'),
        '#type' => 'manage_file',
        '#description' => t('file akan di upload'),
        '#upload_location' => 'public://tmp/',
        '#upload_validators' => array(
            'file_validate_extensions' => array('csv'),
            ),
        );
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('import'),
        );
    return $form;
}
ipin upin
  • 21
  • 1
  • 10
  • did you pass $form_state variable while calling module_name_import_form() ? – mith Feb 13 '17 at 03:40
  • if it is an optional parameter set null value by default. function module_name_import_form($form, $form_state = null) { – mith Feb 13 '17 at 03:41
  • Is this a custom module? $form_state should be passed by reference in drupal 6. You can take a look at the [Drupal 6 docs](https://www.drupal.org/node/751826) to see how to properly format a form for D6. – Frank Robert Anderson Feb 13 '17 at 04:27
  • I also much caution you against putting too much into Drupal 6, it has been end-of-life for nearly a year now. That means there hasn't been any new security updates and there will be no new security releases for Drupal 6. If this is a new project then please take a look at Drupal 8. If Drupal 8 is impossible then please look at Drupal 7 which should have a good 4 years left before end-of-life. Basically, you should only be doing very basic small updates for D6 as they will not work with D7 or D8. – Frank Robert Anderson Feb 13 '17 at 04:29

0 Answers0