Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Relationship when adding 2 contacts where one is an organization #195

Open
shaneonabike opened this issue Dec 17, 2020 · 4 comments

Comments

@shaneonabike
Copy link

Describe the bug
When submitting a form I get "Invalid Relationship"

To Reproduce
Steps to reproduce the behavior:

  1. Processor Contact 1: An individual (the one logging in to use the form)
  2. Processor Contact 2: Linked to an Organization
  3. Processor Relationship Contact 1 / Contact 2 where it is set as [Individual]Employee of - [Organization]Employer of
  4. Processor CiviCRM Address: Contact 2 linked to, Type Main
  5. Processor CiviCRM Address: Contact 2 linked to, Type Home

I made sure that the current logged in user has permission to view/modify the organization

Expected behavior
I assumed that setting this relationship would allow me to update hte address of the organization, but I cannot.

Screenshots
#0 /example.org/wp-content/plugins/cf-civicrm/processors/relationship/class-relationship-processor.php(90): civicrm_api3('Relationship', 'create', Array) #1 /example.org/wp-content/plugins/caldera-forms/classes/core.php(3283): CiviCRM_Caldera_Forms_Relationship_Processor->pre_processor(Array, Array, '_cf_process_5fd...') #2 /example.org/wp-content/plugins/caldera-forms/classes/core.php(5213): Caldera_Forms::process_submission() #3 /example.org/wp-content/plugins/caldera-forms/classes/core.php(3831): Caldera_Forms::process_form_via_post() #4 /example.org/wp-includes/class-wp-hook.php(287): Caldera_Forms->cf_init_system('') #5 /example.org/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #6 /example.org/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #7 /example.org/wp-settings.php(579): do_action('wp_loaded') #8 /example.org/wp-config.php(102): require_once('/var/www/...') #9 /example.org/wp-load.php(37): require_once('/var/www/...') #10 /example.org/wp-admin/admin.php(34): require_once('/var/www/...') #11 /example.org/wp-admin/index.php(10): require_once('/var/www/...') #12 {main}

@Upperholme
Copy link

Did you get this resolved? I need a form where the user (employee) can see and edit a whole bunch of fields that belong to the linked organisation record.

@shaneonabike
Copy link
Author

No I never did BUT you should know that caldera forms is going bye-bye by November. A CiviCRM group is working at converting this to work with Ninja Forms (well making a new extension) so stay tuned.

@Upperholme
Copy link

Thanks for getting back. Yes, I'm aware that Caldera is on the way out, but right now I seem to have little option. If this permission thing isn't working with this plugin though then maybe I need to rethink (again).

@mlutfy
Copy link

mlutfy commented Jul 25, 2022

I stumbled on a site that had this bug, and for some reason, in cf-civicrm/processors/relationship/class-relationship-processor.php:

                        'contact_id_a' => $transient->contacts->{'cid_'.$config['contact_a']},
                        'contact_id_b' => $transient->contacts->{'cid_'.$config['contact_b']},

both refer to the contact ID of contact_a, which causes an invalid relationship for the employer.

However, even if I relax that get/create code, the address/phone of the org is not being updated, so the root is probably elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants