0

I'm trying to make a form with some fields and save the values in Drupal 7 where every user can enter their data. I tried creating a custom entity with an existing database table like so:

    function bank_info_entity_info() {
  return array(
    'bank_info' => array(
      'label' => t('BankInfo'),
      'entity class' => 'Entity',
      'base table' => 'bank_info',
      'field_ui_base_route'=> 'banking',
      'controller class' => 'EntityAPIController',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'user_uid',
        '"bundle"' => 'bank_info',
      ),
      // Use the default label() and uri() functions
      'label callback' => 'entity_class_label',
      'uri callback' => 'entity_class_uri',
      //'module' => 'bank_info',
    ),
  );
}

and I keep getting this error: array_keys() expects parameter 1 to be array, null given common.inc:7334 PHP Warning: Invalid argument supplied for foreach() in /var/www/html/includes/common.inc on line 7314

when I run the command:

drupal_get_schema('bank_info')

It returns false which causes that error. Any ideas?

2
  • but the hook does not get triggered more than once even if I refresh the page several times. Commented Apr 3, 2020 at 1:00
  • Show some code for your hook Commented Apr 3, 2020 at 5:17

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.