From: Coleman Watts Date: Mon, 17 May 2021 22:12:30 +0000 (-0400) Subject: Core_DAO - fire links_callback for all entities even if they don't explicitly declare... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2bc9422f80ea981dc4d87d57a6aaf9a8706122b3;p=civicrm-core.git Core_DAO - fire links_callback for all entities even if they don't explicitly declare links CRM_Core_DAO has a fallback function for entities with no foreign key fields. Previously, that function did not call createReferenceColumns or fire links_callback --- diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 0e901cdc42..c8b6999663 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -526,11 +526,14 @@ class CRM_Core_DAO extends DB_DataObject { /** * Returns list of FK relationships. * - * * @return CRM_Core_Reference_Basic[] */ public static function getReferenceColumns() { - return []; + if (!isset(Civi::$statics[static::class]['links'])) { + Civi::$statics[static::class]['links'] = static::createReferenceColumns(static::class); + CRM_Core_DAO_AllCoreTables::invoke(static::class, 'links_callback', Civi::$statics[static::class]['links']); + } + return Civi::$statics[static::class]['links']; } /**