EntityMetadataWrapperException FATAL ERROR

1 contenuto / 0 new
EntityMetadataWrapperException FATAL ERROR

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. in EntityDrupalWrapper->set() (line 744 of /Users/leo/Sites/acquia-drupal722/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).
The website encountered an unexpected error. Please try again later.

ciao, dopo che smanetto con il modulo group creo un content type e un group type, cancello un group type e il sito nella prossima add content... mi scoppia in faccia e mi da l'errore cui sopra...

alla linea 744 ho questo codice:
/**
* Overridden to support setting the entity by either the object or the id.
*/
public function set($value) {
if (!$this->validate($value)) {
throw new EntityMetadataWrapperException('Invalid data value given. Be sure it matches the required data type and format.');
}
if ($this->info['type'] == 'entity' && $value === $this) {
// Nothing to do.
return $this;
}
$previous_id = $this->id;

risolto così l'errore potendo nuovamente inserire il resto dei content type già creati, altrimenti dovevo reinstallare tutto ma
1 - non so sosa ho fatto
2 - è un bug del modulo? segnalate voi io non so come si faccia
3 - spero di non aver creato una falla nella sicurezza o chissà che altro disastro futuro....
cmq sia mi funziona, ma se avete suggerimeti... a voi la parola, ps sia chiaro che il PHP non ho idea di cosa sia.

il codice corretto sembra perciò questo:
public function set($value) {
if (!$this->validate($value)) {
/*throw new EntityMetadataWrapperException('Invalid data value given. Be sure it matches the required data type and format.');*/
return $this;
}
if ($this->info['type'] == 'entity' && $value === $this) {
// Nothing to do.
return $this;
}

Drupal Version: