Hello everybody!
I'd like to know if anyone tryed to write integration Bean with Inline Entity Form module.
It would be great feature to create related beans right from the node edit page.

Files: 

Comments

Neat Idea. I'm working on this in the inline_ref_field branch.

Cheers,
Neil

I wrote a patch quick last night for the entity boxes module that adds integration with inline entity module if its any help.

http://drupal.org/node/1846998#comment-6761150

I needed to get a demo done for it so I could show a client today but just been shown Bean by a colleague which looks like an overall better solution so would be good to get support for this added :)

FYI as a temporary solution it works really well with References_Dialog (-dev version) to provide a popup dialog rather than an inline form.

Couldn't find this as the issue didn't reference inline_entity_form, so I've closed #1911214: Support for inline_entity_form as a duplicate.

Title:Intergration with Inline Entity FormIntegration with Inline Entity Form

Issue summary:View changes
StatusFileSize
new1.02 KB

Created patch with integration for IEF.

+++ b/bean.info
@@ -6,6 +6,7 @@ files[] = includes/bean.info.inc
+files[] = includes/bean.inline_entity_form.inc

I think you forgot to include this file in the diff

StatusFileSize
new5.78 KB

New patch with the new file. Haven't created a patch with a new file previously, didn't know which branching method would properly pick it up. Sorry for the miss on the first one.

Status:Active» Needs work

Thanks for working on this. I think it will be a great feature. A few comments from the code.

  1. +++ b/includes/bean.inline_entity_form.inc
    @@ -0,0 +1,160 @@
    +  public function entityForm($entity_form, &$form_state) {

    Can we just use the current code in bean_form? It would be nice to not have to worry about keeping the form updated in two different places

  2. +++ b/includes/bean.inline_entity_form.inc
    @@ -0,0 +1,160 @@
    +  /**
    +   * Overrides EntityInlineEntityFormController::entityFormSubmit().
    +   */
    +  public function entityFormSubmit(&$entity_form, &$form_state) {
    +    parent::entityFormSubmit($entity_form, $form_state);
    +  }

    Is this needed? You are just calling the parent class

  3. WIthout having looked at the EntityInlineEntityFormController class, is there any validation? There is quite a bit of code in bean_form_validate and bean_form_submit which is missing. It's very possible that code is not needed I just want to make sure it's caught.

Thank you for this patch. I've been working on an implementation of bean+entityreference+inline_entity_form to add basic block placement functionality to nodes. The results are pretty awesome.

I think all of indytechcook's comments in #9 are legitimate. I think we can find a way to reuse the form code. I haven't yet dug in to the comment regarding validation, but it's definitely something to look into as well.

The one issue I've been banging my head around is with regards to labels and titles.

This particular patch overrides EntityInlineEntityFormController::tableFields() to add label and title to the table of entities. The problem here is that if a bean has a title, the label column will display the title instead of the label.

From what I can tell, this comes from bean's defaultLabel function: http://drupalcode.org/project/bean.git/blob/refs/heads/7.x-1.x:/includes... The code here will return the title if provided, otherwise return the label. I'm still not entirely sure why inline_entity_form is doing this, but figured I'd post a comment indicating that I'm looking in to it.

There is some history and reason to the $entity->label madness.

We mocked the block configure form where you are allowed to have an "block title which can be blank and a "block description" which is required. The problem is that we beans are entities which have pages, are in listing, in views, etc. We needed a way to create a title that will always be there. So we used the logic that if there is a title then use it, otherwise use the label.

Different modules integrate into the entity api differently so we've done our best to adjust.

The patch works sweetly for me. Thanks a lot!

Is there a provision for it to be committed to the 7.x-1.x branch?