2

I deleted my previous post because I am now seeing different behaviour. When looking at a contact record I selection relationships and see this:

enter image description here

I know this contact has multiple relationships but they just don't show here. I added a new relationship , the database tables were updated (I checked) but the relationship doesn't show.

Same for notes as well. I can see no errors being generated at all but it looks , to me with my naive view at the moment, that possibly permissions are not matching?

Any clues

I am running Joomla 4.4.1 , PHP 8.1 and CiviCRM 5.67.2

Edit

I started to look in FormBuilder and have noticed this

enter image description here

See next to the Form Settings all I am getting is a spinning wheel. If I try to create a new form that give me the option to Find Contacts. Is this showing that maybe this report is corrupt in some way?

I have another test instance and went to look in there and see this:

enter image description here

You can clearly see where it shows "Contacts Summary Relationships Active" in the spot where I have the "spinning wheel". What is causing that?

7
  • If you look in the browser console does it have any errors.
    – Demerit
    Nov 30, 2023 at 15:30
  • @Demerit , none that are obvious Nov 30, 2023 at 15:32
  • Are you logged in as user 1 or administrator user? Nov 30, 2023 at 15:39
  • Super user Pradeep Nov 30, 2023 at 15:43
  • You can rule out permissions errors, because the problem is that the display is not rendering. It looks to me like the search displays might be completely missing, based on your second screenshot. Can you open SearchKit and click on "Packaged Searches" - look for a search named "Contact Summary Relationships" with 2 displays. Is it there?
    – Coleman
    Nov 30, 2023 at 15:59

1 Answer 1

3

Import the relationship SK from the searchkit UI

    [
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Contact_Summary_Relationships",
          "label": "Contact Summary Relationships",
          "api_entity": "RelationshipCache",
          "api_params": {
            "version": 4,
            "select": [
              "near_relation:label",
              "RelationshipCache_Contact_far_contact_id_01.display_name",
              "start_date",
              "end_date",
              "RelationshipCache_Contact_far_contact_id_01.address_primary.city",
              "RelationshipCache_Contact_far_contact_id_01.address_primary.state_province_id:label",
              "RelationshipCache_Contact_far_contact_id_01.email_primary.email",
              "RelationshipCache_Contact_far_contact_id_01.phone_primary.phone",
              "permission_near_to_far:label",
              "permission_far_to_near:label",
              "is_active"
            ],
            "orderBy": [],
            "where": [],
            "groupBy": [],
            "join": [
              [
                "Contact AS RelationshipCache_Contact_far_contact_id_01",
                "LEFT",
                [
                  "far_contact_id",
                  "=",
                  "RelationshipCache_Contact_far_contact_id_01.id"
                ]
              ],
              [
                "Case AS RelationshipCache_Case_case_id_01",
                "LEFT",
                [
                  "case_id",
                  "=",
                  "RelationshipCache_Case_case_id_01.id"
                ]
              ]
            ],
            "having": []
          }
        }
      ],
      "match": [
        "name"
      ]
    }
  ],
  [
    "SearchDisplay",
    "save",
    {
      "records": [
        {
          "name": "Contact_Summary_Relationships_Active",
          "label": "Contact Summary Relationships Active",
          "saved_search_id.name": "Contact_Summary_Relationships",
          "type": "table",
          "settings": {
            "description": null,
            "sort": [],
            "limit": 50,
            "pager": {
              "hide_single": true,
              "expose_limit": true
            },
            "placeholder": 5,
            "columns": [
              {
                "type": "field",
                "key": "near_relation:label",
                "dataType": "String",
                "label": "Relationship",
                "sortable": true,
                "icons": [
                  {
                    "field": "permission_far_to_near:icon",
                    "side": "left"
                  }
                ]
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.display_name",
                "dataType": "String",
                "label": "With",
                "sortable": true,
                "icons": [
                  {
                    "field": "RelationshipCache_Contact_far_contact_id_01.contact_sub_type:icon",
                    "side": "left"
                  },
                  {
                    "field": "RelationshipCache_Contact_far_contact_id_01.contact_type:icon",
                    "side": "left"
                  },
                  {
                    "field": "permission_near_to_far:icon",
                    "side": "right"
                  }
                ],
                "link": {
                  "path": "",
                  "entity": "Contact",
                  "action": "view",
                  "join": "RelationshipCache_Contact_far_contact_id_01",
                  "target": "_blank"
                },
                "title": "View Related Contact"
              },
              {
                "type": "field",
                "key": "start_date",
                "dataType": "Date",
                "label": "Dates",
                "sortable": true,
                "rewrite": "[start_date] - [end_date]"
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.address_primary.city",
                "dataType": "String",
                "label": "City",
                "sortable": true
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.address_primary.state_province_id:label",
                "dataType": "Integer",
                "label": "State/Prov",
                "sortable": true
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.email_primary.email",
                "dataType": "String",
                "label": "Email",
                "sortable": true,
                "icons": [
                  {
                    "icon": "fa-ban",
                    "side": "left",
                    "if": [
                      "RelationshipCache_Contact_far_contact_id_01.do_not_email",
                      "=",
                      true
                    ]
                  }
                ]
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.phone_primary.phone",
                "dataType": "String",
                "label": "Phone",
                "sortable": true,
                "icons": [
                  {
                    "icon": "fa-ban",
                    "side": "left",
                    "if": [
                      "RelationshipCache_Contact_far_contact_id_01.do_not_phone",
                      "=",
                      true
                    ]
                  }
                ]
              },
              {
                "text": "",
                "style": "default",
                "size": "btn-xs",
                "icon": "fa-bars",
                "links": [
                  {
                    "entity": "Relationship",
                    "action": "view",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-external-link",
                    "text": "View Relationship",
                    "style": "default",
                    "path": "",
                    "task": "",
                    "condition": []
                  },
                  {
                    "entity": "Relationship",
                    "action": "update",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-pencil",
                    "text": "Update Relationship",
                    "style": "default",
                    "path": "",
                    "task": "",
                    "condition": []
                  },
                  {
                    "task": "disable",
                    "entity": "Relationship",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-toggle-off",
                    "text": "Disable Relationship",
                    "style": "default",
                    "path": "",
                    "action": "",
                    "condition": [
                      "is_active",
                      "=",
                      true
                    ]
                  },
                  {
                    "entity": "Relationship",
                    "action": "delete",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-trash",
                    "text": "Delete Relationship",
                    "style": "danger",
                    "path": "",
                    "task": "",
                    "condition": []
                  },
                  {
                    "entity": "Case",
                    "action": "view",
                    "join": "RelationshipCache_Case_case_id_01",
                    "target": "",
                    "icon": "fa-folder-open",
                    "text": "Manage Case",
                    "style": "default",
                    "condition": []
                  }
                ],
                "type": "menu",
                "alignment": "text-right"
              }
            ],
            "actions": false,
            "classes": [
              "table",
              "table-striped"
            ],
            "toolbar": [
              {
                "action": "add",
                "entity": "Relationship",
                "text": "Add Relationship",
                "icon": "fa-plus",
                "style": "primary",
                "target": "crm-popup",
                "join": "",
                "path": "",
                "task": "",
                "condition": []
              }
            ]
          }
        },
        {
          "name": "Contact_Summary_Relationships_Inactive",
          "label": "Contact Summary Relationships Inactive",
          "saved_search_id.name": "Contact_Summary_Relationships",
          "type": "table",
          "settings": {
            "description": "These relationships are Disabled OR have a past End Date.",
            "sort": [],
            "limit": 50,
            "pager": {
              "hide_single": true,
              "expose_limit": true
            },
            "placeholder": 5,
            "columns": [
              {
                "type": "field",
                "key": "near_relation:label",
                "dataType": "String",
                "label": "Relationship",
                "sortable": true,
                "icons": [
                  {
                    "field": "permission_far_to_near:icon",
                    "side": "left"
                  }
                ]
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.display_name",
                "dataType": "String",
                "label": "With",
                "sortable": true,
                "icons": [
                  {
                    "field": "RelationshipCache_Contact_far_contact_id_01.contact_sub_type:icon",
                    "side": "left"
                  },
                  {
                    "field": "RelationshipCache_Contact_far_contact_id_01.contact_type:icon",
                    "side": "left"
                  },
                  {
                    "field": "permission_near_to_far:icon",
                    "side": "right"
                  }
                ],
                "link": {
                  "path": "",
                  "entity": "Contact",
                  "action": "view",
                  "join": "RelationshipCache_Contact_far_contact_id_01",
                  "target": "_blank"
                },
                "title": "View Related Contact"
              },
              {
                "type": "field",
                "key": "start_date",
                "dataType": "Date",
                "label": "Dates",
                "sortable": true,
                "rewrite": "[start_date] - [end_date]"
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.address_primary.city",
                "dataType": "String",
                "label": "City",
                "sortable": true
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.address_primary.state_province_id:label",
                "dataType": "Integer",
                "label": "State/Prov",
                "sortable": true
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.email_primary.email",
                "dataType": "String",
                "label": "Email",
                "sortable": true,
                "icons": [
                  {
                    "icon": "fa-ban",
                    "side": "left",
                    "if": [
                      "RelationshipCache_Contact_far_contact_id_01.do_not_email",
                      "=",
                      true
                    ]
                  }
                ]
              },
              {
                "type": "field",
                "key": "RelationshipCache_Contact_far_contact_id_01.phone_primary.phone",
                "dataType": "String",
                "label": "Phone",
                "sortable": true,
                "icons": [
                  {
                    "icon": "fa-ban",
                    "side": "left",
                    "if": [
                      "RelationshipCache_Contact_far_contact_id_01.do_not_phone",
                      "=",
                      true
                    ]
                  }
                ]
              },
              {
                "text": "",
                "style": "default",
                "size": "btn-xs",
                "icon": "fa-bars",
                "links": [
                  {
                    "entity": "Relationship",
                    "action": "view",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-external-link",
                    "text": "View Relationship",
                    "style": "default",
                    "path": "",
                    "task": "",
                    "condition": []
                  },
                  {
                    "entity": "Relationship",
                    "action": "update",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-pencil",
                    "text": "Update Relationship",
                    "style": "default",
                    "path": "",
                    "task": "",
                    "condition": []
                  },
                  {
                    "task": "enable",
                    "entity": "Relationship",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-toggle-on",
                    "text": "Enable Relationship",
                    "style": "default",
                    "path": "",
                    "action": "",
                    "condition": [
                      "is_active",
                      "=",
                      false
                    ]
                  },
                  {
                    "entity": "Relationship",
                    "action": "delete",
                    "join": "",
                    "target": "crm-popup",
                    "icon": "fa-trash",
                    "text": "Delete Relationship",
                    "style": "danger",
                    "path": "",
                    "task": "",
                    "condition": []
                  }
                ],
                "type": "menu",
                "alignment": "text-right"
              }
            ],
            "actions": false,
            "classes": [
              "table",
              "table-striped",
              "disabled"
            ]
          }
        }
      ],
      "match": [
        "saved_search_id",
        "name"
      ]
    }
  ],
  [
    "Afform",
    "save",
    {
      "records": [
        {
          "type": "search",
          "title": "Relationships",
          "permission": [
            "access CiviCRM"
          ],
          "placement": [
            "contact_summary_tab"
          ],
          "icon": "fa-handshake-o",
          "summary_weight": 80,
          "permission_operator": "AND",
          "layout": "<div af-fieldset=\"\">\n  <div class=\"alert alert-warning\">\n    <strong>{{:: ts('Permissioned Relationships:') }}</strong>\n    <i class=\"crm-i fa-eye\"></i> {{:: ts('This contact can be viewed by the other.') }}\n    <i class=\"crm-i fa-pencil-square\"></i> {{:: ts('This contact can be viewed and edited by the other.') }}\n  </div>\n  <crm-search-display-table search-name=\"Contact_Summary_Relationships\" display-name=\"Contact_Summary_Relationships_Active\" filters=\"{near_contact_id: options.contact_id, is_current: true}\"></crm-search-display-table>\n  <crm-search-display-table search-name=\"Contact_Summary_Relationships\" display-name=\"Contact_Summary_Relationships_Inactive\" filters=\"{near_contact_id: options.contact_id, is_current: false}\"></crm-search-display-table>\n</div>\n",
          "name": "afsearchTabRel",
          "modified_date": "2023-11-30 15:10:47",
          "requires": null,
          "entity_type": null,
          "join_entity": null,
          "description": null,
          "summary_contact_type": null,
          "server_route": null,
          "is_public": false,
          "redirect": null,
          "submit_enabled": true,
          "submit_limit": null,
          "create_submission": null,
          "navigation": null
        }
      ]
    }
  ]
]
1
  • Thanks Coleman , that has worked! Nov 30, 2023 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.