civicrm / org.civicrm.contactlayout

Customize the contact summary screen
Other
15 stars 20 forks source link

blockContactType is always an array #144

Closed MegaphoneJon closed 5 months ago

MegaphoneJon commented 5 months ago

https://github.com/civicrm/org.civicrm.contactlayout/pull/124 added support for multiple contact types for each block or tab. But I was seeing this error:

PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /home/jon/local/mysite/web/wp-content/civicrm-custom/extensions/org.civicrm.contactlayout/CRM/Contactlayout/BAO/ContactLayout.php:200"

That's because we were setting $blockContentType to NULL instead of an empty array, but then using it in places that required an array. I've fixed that and tightened up the type hint.

colemanw commented 5 months ago

Great thanks @MegaphoneJon