I exported all my message types, fields, ... as features and imported them.

But somehow the message_type was not created/activated.
Which resulted in this error?

EntityMetadataWrapperException: Unknown data property message_text. in EntityStructureWrapper->getPropertyInfo() (line 339 of /data/www/sas-webstore/www/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).

What can I do?

Can I activate it somehow?

Comments

Not sure why this happened but I ran

the following code via the /devel/php and then the message_text field was created

<?php
 
// Create the message text field for our message type category.
 
$instance = array(
   
'field_name' => MESSAGE_FIELD_MESSAGE_TEXT,
   
'bundle' => 'commerce_order_message',
   
'entity_type' => 'message_type',
   
'label' => t('Message text'),
   
'description' => t('This is the text of all messages of this type.'),
   
'required' => TRUE,
   
'settings' => array(
     
'text_processing' => 1,
     
// Mark that this field can be rendered using Message::getText().
     
'message_text' => TRUE,
    ),
  );
  if (
$existing_instance = field_info_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'])) {
   
field_update_instance($instance);
  }
  else {
   
field_create_instance($instance);
  }
 
// Add a display name field.
 
$field = array(
   
'field_name' => 'message_order_display_name',
   
'type' => 'text',
   
'module' => 'text',
   
'cardinality' => '1',
   
'translatable' => TRUE,
   
'settings' => array(
     
'max_length' => '255',
     
// Mark that this field can be rendered using Message::getText().
     
'message_text' => TRUE,
    ),
  );
  if (
field_info_field($field['field_name'])) {
   
field_update_field($field);
  }
  else {
   
field_create_field($field);
  }
 
$instance = array(
   
'field_name' => $field['field_name'],
   
'bundle' => 'commerce_order_message',
   
'entity_type' => 'message_type',
   
'label' => t('Display name'),
   
'description' => t('The name of this message type as displayed in logs.'),
   
'required' => TRUE,
   
'settings' => array(
     
'text_processing' => 0,
    ),
  );
  if (
$existing_instance = field_info_instance($instance['entity_type'], $instance['field_name'], $instance['bundle'])) {
   
field_update_instance($instance);
  }
  else {
   
field_create_instance($instance);
  }
 
// Add text format if it doesn't exist.
 
if (!filter_format_load('commerce_order_message')) {
   
$format = (object) array(
     
'format' => 'commerce_order_message',
     
'name' => 'Commerce Order Message',
     
'weight' => 0,
     
'filters' => array(
       
// HTML filter.
       
'filter_html' => array(
         
'weight' => 1,
         
'status' => 1,
        ),
      ),
    );
   
filter_format_save($format);
  }
?>

I'm going to put it in a update_hook and in the install_hook of my module.

Version:7.x-1.8» 7.x-1.9

there's a similar issue on Commerce Message issue queue : #2053821: EntityMetadataWrapperException error every time new orders are entered.

I've had the same error.
Reinstalling the message module resolved the issue.

Re-installing seemed to take care of this for me too (I am on v1.7 though).

Version:7.x-1.9» 7.x-1.x-dev
Priority:Normal» Major

Setting major as this makes the module unusable.
For me this is fixed by #2108283: Entity language info missing.
Please review so we can get this in.

Issue summary:View changes

Running #1 solved the error message, but the message description is empty (even when creating a new)

removing, unsinstalling, installing commerce kickstart orders and commerce message solved this.