Can this module reference any entity since I can see the option to choose any entity on my site, but when I view edit form field dosent show at all. Am I missing something or this is not implemented yet?
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | eck-inline_entity_form_support-1689726-21.patch | 2.51 KB | acrazyanimal |
| #19 | reference-other-entities-1689726.patch | 1.98 KB | aptorian |
| #14 | reference-other-entities-1689726-14.patch | 2.02 KB | Anonymous (not verified) |
| #9 | reference-other-entities-1689726-9.patch | 2.23 KB | stevector |
| #6 | reference-other-entities-1689726-6.patch | 2.25 KB | Anonymous (not verified) |
Comments
Comment #1
rogical commentedwhat entities? Currently it only supports commerce entities and nodes.
Comment #2
bojanz commentedI don't understand.
Are you looking to reference existing entities, or looking to use this module on other entity types (that aren't commerce_product or node)?
Comment #3
dmiric commentedI would like to use it with ECK entities.
Comment #4
bojanz commentedYou will need to write a controller for any extra entity type (see the node one that ships with IEF as an example).
Not sure if that means 1 controller for all ECK types, or one per ECK type.
Comment #6
Anonymous (not verified) commentedHi
Attached is a patch for supporting ECK entities.
I also created a submodule in a sandbox, but for the few changes, a patch is preferred.
Sandbox: http://drupal.org/sandbox/timleytens/1808436
Greets
TimLeytens
Comment #7
victory17 commentedI also wanted to add a note, the patch above does this for eck entities. But for a quick and easy way to support a custom entity you can also add
To your entity_info declaration. Then you can override the inlineentityformcontroller provided by the inline Enity form module. The readme file is a little vague on this.
Comment #8
Jorrit commentedPatch #6 doesn't allow me to enter any fields except the title, although I have selected just one ECK entity bundle and that bundle has extra fields.
This is because
$entity->typeis given as the first argument tofield_attach_form(), but$entity->typecontains the bundle, not the entity type name. In a lot of cases, this is the same, but for me it wasn't.The right code is:
field_attach_form($entity_form['#entity_type'], $entity, $entity_form, $form_state, LANGUAGE_NONE);I hope this can be committed quickly!
Comment #9
stevectorThanks Jorrit. This revision of the patch corrects that problem with $this->entityType instead of $entity_form['#entity_type'] as it's a little more direct.
Comment #10
Jorrit commentedI did't know that
$this->entityTypeexisted, thanks for correcting that. One little remark however: I now see that the patch adds an explicit title field. It is possible to unselect the title field for an entity. Does your patch take that into account?Comment #11
stevectorI only changed the one line in the patch and can't explain the extra title field. TimLeytens, do you know what that is for?
Comment #12
Anonymous (not verified) commentedTitle is a required field for every (ECK) entity. But title is an entity property and field_attach_form only adds the field API fields to the entity, not the entity property fields.
Greets
TimLeytens
Comment #13
Jorrit commentedTim: this may have changed recently, but when I create an entity type, I get the choice if I want a title field or not. The complete list of choices is title, created, changed and author. The selected properties are available in
EntityType::loadByName('ENTITY_TYPE')->properties.Maybe it is better to reuse the existing form from
eck__entity__form().Comment #14
Anonymous (not verified) commentedIndead, I thought title was required, we could use following patch.
I unset the submit, because Inline entity form adds his own buttons
Greets
TimLeytens
Comment #15
pebosi commentedPatch #14 works for me
Comment #16
garphyPatch in #14 works for me.
Comment #17
garphyIt may be worth noting that the proposed implementation does not integrate the hooks form_validate and form_submit from ECK. They actually do more or less the same that IEF's default controller implementation as they both invoke entity API in the end but we should be aware that future evolution of ECK could lead to force us to implement a custom entityFormValidate() & entityFormSubmit() implementations.
(my .02€ tough)
Comment #18
bojanz commentedI think this integration should live inside the ECK module.
Comment #19
aptorian commentedThe above patch was not applying on the latest release for me... seems like it went off by a line or something. Applied changes manually and made a new patch, if anyone needs it.
Comment #20
adamelleston commentedHas anyone else tried the path in #19 as it doesn't seem to work for me. Not sure if i am doing something wrong or not.
Comment #21
Jorrit commentedIt is a patch for the Inline Entity Form module, not for the ECK module. The project for this issue was changed. The patch works for me.
Comment #22
acrazyanimal commentedUm .. first I would like to say inline entity form is awesome!
So, I have re-rolled the patch from #14 to apply against the latest eck 7.x-2.x snapshot. I would love to commit this as it just made my mind explode!!! However, it would be great if some others could test this patch out and supply some feedback. Once its marked RTBC I'll commit it.
Comment #23
acrazyanimal commentedForgot to click attach for the patch .. here it is
Comment #24
garphypatching fails here
Are you sure it's rolled against 2.x-dev and not 1.x-dev ?
Comment #25
garphynevermind...
i checked out the wrong git branch.
the patch apply cleanily, i'll test it out
Comment #26
acrazyanimal commentedHmm, yep I am absolutely certain it was against 7.x-2.x branch. I tested the patch as well git apply -v eck-inline_entity_form_support-1689726-21.patch and it worked fine for me. I had freshly cloned 7.x-2.x.
Comment #27
acrazyanimal commented:)
Comment #28
garphyWhat's weird is that is does apply cleanily on a git clone but not on the 7.x-2.x-dev tgz (tested trough drush make)
I think it's because of the additional information that d.o adds when it packages the module
maybe if we remove the comments you added in the .info in the patch it will apply more easily. I'll test that out
Comment #29
acrazyanimal commentedProbably the case. I don't think its necessary to apply it against the tar since it will be committed on top of the 7.x-2.x HEAD and drupal will add the packaging info to the bottom of what it there. So there won't be conflicts once its committed.
Comment #30
acrazyanimal commentedCommitted
Comment #32
Gaelan commentedThis might be better for a separate issue, but we really should use a proper plural form here. Not sure how do do it offhand other than adding a "Plural Form" field to the config.
Comment #33
acrazyanimal commented@Gaelan: Can you make this a separate issue please.
Comment #38
Rastra commentedI am new to Drupal but looking at the Inline Entity Form, it is great and will solve many of my current requirements. In my project I building all the entities using Entity API and not ECK. These entities are referenced.
Now I want to make sure that they can use the features provided by Inline Entity Form. What codes I need to write in my module so that it is cable of using the Inline Entity Form.
Comment #39
Rastra commentedOK, I have tried and I could get the buttons but it is giving me the AJAX error "Unsupported Operand Type on line 1808 of durpal/include/forms.inc". I am sure someone must have done it before and if it can be extended for ECK entity, it should be possible for others as well. Any suggestion will be great.
I have been able to show the form inline and save the data but the data is not being displayed in the table for edit and delete. Some help will be appreciated.
Comment #40
mengi commented@Rastra, this is the ECK queue and it seems like your not using ECK. You'll have a better chance of getting help by going to the inline_entity_form queue and asking there.
Also try avoiding posting in closed issues since most people will not notice your comment.