EntityMalformedException: Missing bundle property on entity of type node in modal I want to open create content type in modal, according to modal form and modal api example, I implement it, I test

the problem is here
when I test it by contact form 

    ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    // 'title' =&gt; t('Contact'),
    'ajax' =&gt; TRUE,
  );
  module_load_include('inc', 'contact', 'contact.pages');
  $output = ctools_modal_form_wrapper('contact_site_form', $form_state);


every thing work correctly and  there is no problem,but when I change it to 

ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    // 'title' =&gt; t('Contact'),
    'ajax' =&gt; TRUE,
  );
module_load_include('inc', 'node', 'node.pages');
$output = ctools_modal_form_wrapper('page_node_form', $form_state);


return me **
An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /drupal-7.24/share/ajax/1
StatusText: Service unavailable (with message)
ResponseText: EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7724 of /includes/common.inc).** , where is the problem?

I create a menu, and it open a modal,I want add content in that modal
EntityMalformedException: Missing bundle property on entity of type node


This means that at some point in code when the node entity should be handled, it is unclear what type (bundle) that is. Now when you look at node_form() you see that it expects a node object as a parameter. If that's not given the node add form doesn't know what fields and properties to render because the node type can't be identified. Looking further into node_add(), which is the function normally called to create a new node of a specific type, I think you could go along the following lines (completely untested):

global $user;
ctools_include('modal');
ctools_include('ajax');
$node = (object) array(
  'uid' =&gt; $user-&gt;uid,
  'name' =&gt; (isset($user-&gt;name) ? $user-&gt;name : ''),
  'type' =&gt; 'page',
  'language' =&gt; LANGUAGE_NONE,
);
$form_state = array(
  'ajax' =&gt; TRUE,
  'build_info' =&gt; array(
    'args' =&gt; array($node),
  ),
);
module_load_include('inc', 'node', 'node.pages');
$output = ctools_modal_form_wrapper('page_node_form', $form_state);