0

Before creating "form" custom module, everything was fine. After creating this module, I have got the following error message:

Cannot use string offset as an array in includes\form.inc on line 3575

I deleted the entire custom module folder, and cleared the cache as well. Still, I am getting the same error when modules page.

How do I overcome this error?

coding inside the form.module page is

        function form_menu() {
      $items = array();
      $items['form/form'] = array(
        'title' => t('My form'),
        'page callback' => 'form_form',
        'access arguments' => array('access content'),
        'description' => t('My form'),
        'type' => MENU_CALLBACK,
      );
      return $items;
    }

    /**
    * This function gets called in the browser address bar for:
    * "http://yourhost/form/form" or
    * "http://yourhost/?q=form/form". It will generate
    * a page with this form on it.
    */
    function form_form() {

      // This form calls the form builder function via the
      // drupal_get_form() function which takes the name of this form builder
      // function as an argument. It returns the results to display the form.
      return drupal_get_form('form_my_form');

    }

    /**
    * This function is called the "form builder". It builds the form.
    * Notice, it takes one argument, the $form_state
    */
    function form_my_form($form_state) {

        // This is the first form element. It's a textfield with a label, "Name"
      $form['name'] = array(
        '#type' => 'textfield',
        '#title' => t('Name'),
      );
      return $form;
    }
10
  • Try disable/uninstall the module and clear the cache.
    – niksmac
    Commented Mar 12, 2013 at 11:26
  • The OP said, "I deleted the entire custom module folder, and cleared the cache as well."
    – avpaderno
    Commented Mar 12, 2013 at 11:33
  • Somewhere in your form there is a property that should have a # in front of it. Without seeing your code it's impossible to help any further
    – Clive
    Commented Mar 12, 2013 at 11:34
  • 1
    And when you say 'deleted', you did disable and uninstall it first right?
    – Clive
    Commented Mar 12, 2013 at 11:35
  • 1
    @uma Doing that is never a good idea I'm afraid, no telling what it will break. Try removing the row for your custom module from the system table completely, that should reset it. But make a DB backup first of course
    – Clive
    Commented Mar 12, 2013 at 11:57

2 Answers 2

0

Deleting the module folder outright, without uninstalling it through the UI/Drush (even manually in the DB) is bound to cause a few problems.

To get rid of any errors caused by Drupal thinking the module files are still there, you can simply delete the row in the system table which corresponds to the relevant module; but make a database backup first, of course.

In case you haven't come across the pages before, you can disable modules at http://mysite.com/admin/modules and uninstall them at http://mysite.com/admin/modules/uninstall through the UI, or use Drush.

0

Run update.php after disabling that form module. My problem has been solved after doing this.

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.