0

I'm on CiviCRM 5.6.0 on WordPress 4.9.8, and I have created some custom relationships, all with contact type A of individual, and contact type B of organization.

When I go to Search -> Advanced Search and expand the Relationships section, I get this notice: Network Error Unable to reach the server. Please refresh this page in your browser and try again.

When I check the logs, this is the full error message that occurs when I expand the Relationships section:

[Wed Oct 24 15:42:05.499499 2018] [proxy_fcgi:error] [pid 32638:tid 140566905980672] [client X.X.X.X:56697] AH01071: Got error 'PHP message: PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search.php on line 301\nPHP message: PHP Warning: array_key_exists(): The first argument should be either a string or an integer in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Search.php on line 301\n', referer: https://XXXX/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontact%2Fsearch%2Fadvanced&reset=1

On another instance of CiviCRM 5.5.2, also on WordPress, on which I have not created any custom relationship types, I do not get this error. I tried disabling all the custom relationships I created in the instance on which I'm having issues but the error still occurs.

Anyone have any ideas on what might be going on? Thanks.

  • so are you saying this is not happening when you do anything else either in Adv Search or eg on a Contact Record - seems odd it would relate to custom Relationship Types (assuming you didn't somehow get away with naming two the same) – petednz - fuzion Oct 25 '18 at 5:52
  • and are both systems on bitnami? – petednz - fuzion Oct 25 '18 at 5:53
  • 1
    Thanks for the responses -- yes both systems are on Bitnami on Amazon Lightsail. And correct, I don't see errors when I expand any of the other sections in advanced search, only the relationships. I added a couple of test relationships in the system that IS working and that didn't seem to break it. I'll take a look at the relationship records directly in the database to see if anything looks amiss there. – Matt Woodward Oct 25 '18 at 16:49
  • Bit more info on this, I have a dev copy of this exact same site on another Lightsail instance, just with older data, and it doesn't have this issue. On the instance that's throwing the error I deleted all the relationship types I created thinking maybe there was some data related to one of them that was throwing things off, and I still get the error. Is there some way to turn on more verbose debugging so I can see more details when the error occurs? – Matt Woodward Oct 26 '18 at 17:31
  • Poked around more and found this in the CiviCRM log in the ConfigAndLog directory: Element 'custom_37_from' does not exist in HTML_QuickForm::addRule() There's more to the error message but that seems to be the crux of it. I'm not sure what it's trying to reference that no longer exists, but I'll dig further. If anyone has guidance I'm all ears! Thanks. – Matt Woodward Oct 26 '18 at 17:42
1

So this all boiled down to this issue, which has to do specifically with custom fields that are integer selects, and it was impacting both the custom fields and the relationships sections of the advanced search since I was using the same custom field on a custom relationship.

The short-term fix is I went into the database and made the custom field in question not searchable and set is_search_range to 0 as well, which resolved the issue with the relationships section on advanced search throwing an error.

That does mean that for the time being I can't search by that custom field, which is unfortunate since it's kind of a key piece of what I might want to sort/filter by, but I'll keep an eye on the bug and if push comes to shove I can always change that custom field into a text field and rework things since in this case although the data is integers it doesn't have to be since I'm not running math on it or anything, it's essentially just a numeric label.

Hope that helps someone else who runs into this with some thought process or at least raises awareness about the bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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