Closed (fixed)
Project:
RedHen CRM
Version:
7.x-1.x-dev
Component:
redhen_contact
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2012 at 14:18 UTC
Updated:
23 Jun 2014 at 23:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
valderama commentedHere is a basic working version...
I am happy on suggestions or other input!
Comment #2
bojanz commentedSounds good, but that code should live in one of RedHen's modules, not IEF.
Comment #3
seanberto commentedI'd like to test this patch. Could you give me a use case for this feature?
Comment #4
valderama commentedBasically the use case is to have a (presentatinal) node for a contact, with an embedded redhen contact. Proving an easy way to edit the redhen contact from the within node improves the editor experience (IEF provides that)
Does that help?
Comment #5
seanberto commentedThat makes sense, Walter. We'll test the patch and follow up soon.
Comment #6
seanberto commentedComment #7
seanberto commentedSo, I just tested adding this controller to RedHen Contact. Attached is a simple patch that basically includes the new controller library file, calls it in the .info file and then declares the controller for the the RedHen Contact entity type.
After running the patch, I can add an inline entity reference field to a simple content type. It includes the first and last name properties for a RedHen contact on the node add/edit form. However, none of the attached fields on my RedHen Contact bundle are being included in the inline entity form. Also, it doesn't look like the entity bundle is being passed into the controller. So, while the RedHen Contact is being saved, we get the following PHP error:
In short, this patch needs work. We're headed in the right direction, but it's not there yet.
Please feel free to play around and reroll a patch when ready. This isn't tops on ThinkShout's priority list for RedHen, so we'd appreciate those interested in this functionality playing with it a bit and getting us a patch to test against the development branch.
Thanks!
Comment #8
seanberto commentedComment #9
seanberto commentedComment #10
micnap commentedSetting the $contact->type = 'contact' was what was preventing the form from showing. I also added the middle name field. Seems to work great!
Comment #11
seanberto commentedNice! I'll review when I can. I've already got a need for this on a project I'm working on....
Could you confirm, are we correctly saving the other properties on the RedHen Contact record? Like the Author ID?
Comment #12
micnap commentedOh yeah. Good question.
checking...
Yup. Author id, revision id, type, and created and updated dates all saved correctly.
Comment #13
dunklea commentedApplied patch from #10 worked for me. Thanks, guys!
Comment #14
levelos commentedThanks Mickey, and sorry for taking so long to get to this. Committed in 1.x branch.
Comment #15
seanberto commentedw00t! Great to work on a patch with you two. I do such little dev work these days. ;)
Comment #17
philipz commentedHi guys thanks for working on this. It's not working for me unfortunately.
The form is not showing up at all as when the controller is not defined. I've added support for inline entity form controller to Entityforms myself and it works fine (adding patch today I hope) so I'm a little experienced in this but can't find any problems in code for RedHen Contact.
One strange thing is that enabling IEF just for entityform works but when I enable for RedHen Contact too (on the same entity) I'm getting
EntityMalformedExceptionwithentity_extract_idserror.Not sure if this is related at all though.
Comment #18
ahillio commentedI'm using 1.x-dev from Nov 27 and the inline entity widget is enabling me to create contacts, just like magic. Can't create organizations though, but I guess that would be a separate feature request....
Comment #19
philipz commentedWhich kind of entity is your IEF widget attached to?
I'm trying to use it on Entityform and I guess this is the source of my problem.
Comment #20
ahillio commentedIEF successfully working on Redhen's "organization" entity and on Casetracker's "project" entity. I created this site over the weekend, brand new.
But NOT working on an older site that was previously using Redhen 1.6 but migrated to a codebase that's using Redhen 1.x-dev from Nov27. The sites are in Aegir so I migrated the site from an old platform to a current platform and the migration process runs drush updatedb and so forth. Not working means that the field does not display on edit form when using the IEF widget, but switching widget to autocomplete and the field does show. This site uses the same code as the site on which IEF does work. Hmmm...
BTW, if it makes any difference - I'm not using the above patch, but the newer version of the module that the patch was committed to.
Comment #21
RecoveryHub commentedHi micnap, thanks for your work on this. I noticed the original request mentioned being able to edit both Contacts and Organizations inline. I have a content type where I need to both create a contact and organization inline while creating the node. Contacts inline seems to be working fine but Organizations isn't. Can you help?
Best
Tyler
Comment #22
RecoveryHub commentedAny ideas on this? Thanks!
Comment #23
levelos commentedOrigin issue is still closed, pls don't reopen. If anyone is having subsequent issues, report separately.