Help to understand and fix this entity error message I get this error message:


  Error: Notice: Undefined index: label en EntityDefaultMetadataController::bundleOptionsList() (línea 113 de/Applications/MAMP/htdocs/rooms/sites/all/modules/entity/entity.info.inc).**


The line causing the error message is contained in the following function:

 /**
   * A options list callback returning all bundles for an entity type.
   */
  public static function bundleOptionsList($name, $info) {
    if (!empty($info['parent']) &amp;&amp; $type = $info['parent']) {
      $entity_info = $info['parent']-&gt;entityInfo();
      $options = array();
      foreach ($entity_info['bundles'] as $name =&gt; $bundle_info) {
        /* LINE 113 */ $options[$name] = $bundle_info['label']; /* LINE 113 */
      }
      return $options;
    }
  }


I don't know what other information I can include in this question because I have no idea what the cause could be. I think it is related to the Entity module because the file is inside Entity module.

Why am I getting that notice message? Is there a way to stop getting it?
Looking at the code of the Entity module, I noticed that the $info['parent']-&gt;entityInfo() method is the one defined in entity.inc, and it returns the value obtained from entity_get_info(). The reason you are seeing that error is that there is a module defining an entity type and which forgets to define the label for its bundles. The core modules always define the label for their bundles.

  /**
   * Set up the object instance on construction or unserializiation.
   */
  protected function setUp() {
    $this-&gt;entityInfo = entity_get_info($this-&gt;entityType);
    $this-&gt;idKey = $this-&gt;entityInfo['entity keys']['id'];
    $this-&gt;nameKey = isset($this-&gt;entityInfo['entity keys']['name']) ? $this-&gt;entityInfo['entity keys']['name'] : $this-&gt;idKey;
    $this-&gt;statusKey = empty($info['entity keys']['status']) ? 'status' : $info['entity keys']['status'];
  }

  /**
   * Returns the info of the type of the entity.
   *
   * @see entity_get_info()
   */
  public function entityInfo() {
    return $this-&gt;entityInfo;
  }


The Rooms module should give a value for the label property for its bundles, or the Entity module should not assume the label is always given. I don't see anything that says the bundle label is always present, even though I suspect it is a required property.