when i install this module and refresh the homepage,then give me the message:

Fatal error: Call to a member function entityType() on a non-object in /sites/all/modules/eck/eck.entity.inc on line 348

version = "7.x-2.0-rc3+15-dev"

the code:

  // Property Widget Handling through property_info by entity api.
  $property_info = entity_get_property_info($entity->entityType());
  $properties = array();
  $found_widget = FALSE;
  foreach ($property_info['properties'] as $pname => $pi) {
    if (array_key_exists('widget', $pi)) {
      $widget_callback = $pi['widget'];
      $widget = $widget_callback($entity);
      $properties[$pname] = $widget_callback;
      $form[$pname] = $widget_callback($entity);
      $found_widget = TRUE;
    }
  }

but the backend of the site is narmal.her are some screnshorts.

CommentFileSizeAuthor
wuhanyouthpalace.drupal.test.com_.png913.53 KBJochen.Zhang
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jochen.Zhang’s picture

Issue summary: View changes
Parent issue: » #1155832: Entity Construction Kit (ECK)

if i modify the code in /sites/all/modules/eck/eck.entity.inc on line 341,i add "&" before the $entity.
function eck__entity__form($form, &$form_state, &$entity) {

and the is give me the error:

Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 7088 of /includes/common.inc).
Notice: Trying to get property of non-object in eck__entity__add() (line 229 of /sites/all/modules/eck/eck.entity.inc).
Notice: Trying to get property of non-object in eck__entity__add() (line 229 of /sites/all/modules/eck/eck.entity.inc).
Notice: Undefined index: controller class in entity_create() (line 463 of /sites/all/modules/entity/entity.module).
Warning: class_implements(): object or string expected in entity_create() (line 463 of /sites/all/modules/entity/entity.module).
Warning: in_array() expects parameter 2 to be array, boolean given in entity_create() (line 463 of /sites/all/modules/entity/entity.module).
Warning: Parameter 3 to eck__entity__form() expected to be a reference, value given in drupal_retrieve_form() (line 841 of /includes/form.inc).
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 7088 of /includes/common.inc).
Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of /sites/all/modules/entity/entity.info.inc).

fmizzell’s picture

I have not seen this error before.. I am not sure when entityType() was introduced in the entity module, but I would first check your version of the entity module to make sure it is up to date.

mrsinguyen’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Priority: Normal » Major

I tested on ECK 7.x-2.0-rc7, got error below:

Fatal error: Call to a member function entityType() on a non-object in modules/contrib/core/eck/eck.entity.inc on line 359

PHP version PHP Version 5.5.20

fmizzell’s picture

@mrsinguyen, can you give a little more context on what you were doing when the error came up?

eric.napier’s picture

Status: Active » Postponed (maintainer needs more info)

Is this still an issue? Can someone provide steps for reproducing this issue with a clean install of Drupal 7 and eck 7.x-2.x-dev? I have tried but cannot reproduce the issue, will need more info.

Kristen Pol’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing this since there has been no activity in many years. Please re-open if it's still relevant.