How to show an Inline Entity Form on a PM page or panel? I'm trying to include an Inline Entity Form on a panels display (via ctools Page Manager).

The Inline Entity Form field is attached to users, and the page in question has the user's context. 

The Inline Entity Form field does appear in the panels interface, in two different ways, but neither work:


As a "User" field content type

It simply displays the text 1

As a "User (tokens)" content type

It simply displays the text 1

As a "Form" content type

It simply display the text Entity info
This is a very crude, brute force answer. Basically, it's: create a PHP block that loads the user edit form with all fields except the Inline Entity Form field hidden, then display it. 


Enable PHP Filter module (part of Core but disabled by default)
Create a new block with this code:


..

&lt;?php
global $user;
module_load_include('inc', 'user', 'user.pages');
$account = user_load($user-&gt;uid);
$form = drupal_get_form('user_profile_form', $account);
print render( $form );
?&gt;



Hide the fields except the ones you want. Two ways to do this:


The tricky, 'proper' way: in the block, hide the array elements in $form by either unsetting or setting type to hidden. There could be complications with this.
The quick and dirty but safe way: just set them to display: none; with CSS. This way the full form is present and unadulterated, but invisible.





This is fine unless you're adding a multiple values Inline Form to a user profile. If that's the case, when you try to add a new item to the multiple value field, you'll hit this error:


  Call to undefined function user_profile_form_validate()


It's because the AJAX doesn't know it's dealing with a user form and so doesn't think to load the necessary pages from the user module. The only way around that I can find is to create a custom module with the following (then flush caches etc):

function custom_module_name_init() {
    module_load_include('inc', 'user', 'user.pages');
}


This isn't ideal since it loads a page of code which is normally unnecessary everywhere - but the overheads for PHP scanning then ignoring one sheet of code are pretty small. If anyone knows a cleaner way to do this, however, please share it!