When adding a relation to a contact (redhen/contact/%/connections/add), the connection type switcher does not work properly. After making a selection in the connection type, the "New or existing..." switcher does not work correctly.
One problem is that the ajax callback redhen_relation_form_refresh()
replaces the given form component with an entirely different component. Updating the return value of it to be simply return $form['fields'];
can fix that aspect.
The remaining problem is in the result of choosing new or existing. We currently have two main sections of the form: the Relation part (using the form element ID of "fields"), and the added or selected entity that is on the other end of the relation (using the form element ID of "entity_info"). So when the "fields" portion is refreshed, the "entity_info" section is not updated and continues to hold the form for the wrong entity.
A couple of ideas: either moving the entity form up inside the "fields" section, or reworking the form refreshing.
Comment | File | Size | Author |
---|---|---|---|
#6 | redhen_relation_ajax_fix-2428227-6.patch | 5.71 KB | anemirovsky |
Comments
Comment #1
levelos CreditAttribution: levelos at ThinkShout commentedWhat "new or existing" selector are you referring to? The add a connection interface does not provide the ability to create new orgs or contacts inline.
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI am experiencing this.
Goto a connection
Setup multiple relation types
Now add a relation at a link like /redhen/contact/3/connections/add
There is a box that allows you to enter new or existing.
When you first goto the page, contact/x/connections/add, new is selected.
When you switch between new and existing for the relation type, I am finding that it actually works.
But if you go to the top of the page and choose a different relation type, then nothing happens. Nothing is updated.
Comment #3
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedIs there anyway to get this fixed.
This seems to be pretty fundamental.
Possible help:
https://www.drupal.org/node/2324953
if a relation is chosen, the entire form should be updated so that both the new-existing field and a relationship attached should be updated.
In the added relationship portion only entities that are available given the current chosen relation and entity should be displayed.
Comment #4
ehanuise CreditAttribution: ehanuise commentedSimilar issue here with another aspect of this :
- define a contact to contact relationship type, and a contact to org relationship type
- go to a contact
- add relationship. the 'contact to org' is the default but a popup list aloows me to pick the 'contact to contact' type
- pick 'contact to contact'
- the bottom of the form does not refresh, and keeps offering me new/existing org as the target
- I have to submit empty to gen an error message and the proper form now displaying contact targets instead of org targets
Comment #5
anemirovsky CreditAttribution: anemirovsky at Giant Rabbit, LLC commentedIt looks like this was broken during a refactoring of this form in https://github.com/thinkshout/redhen/commit/e95592b40d9a386452f91f06ef79.... There were a few issues here:
Comment #6
anemirovsky CreditAttribution: anemirovsky at Giant Rabbit, LLC commentedI found a couple more problems which this update patch addresses.
Comment #7
gcbComment #9
gcbAbove patch did not resolve the issue for me. I have refactored this logic in commit 142c6e6. There is still some strangeness specifically with adding contacts when we have different types, but this is an improvement.
Remaining issue:
when creating a relation TO another contact, when you have multiple contact types, the form breaks down after using the contact-record-type selector more than once.
Downgrading to "minor".