From 9162496e16a50bfda0cd1a23c21affcadd15cd85 Mon Sep 17 00:00:00 2001
From: Coleman Watts <coleman@civicrm.org>
Date: Wed, 12 Aug 2020 16:58:55 -0400
Subject: [PATCH] DAO - only check version on fields from core tables

---
 CRM/Core/DAO.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php
index 96da596f6b..d410b1e270 100644
--- a/CRM/Core/DAO.php
+++ b/CRM/Core/DAO.php
@@ -552,7 +552,8 @@ class CRM_Core_DAO extends DB_DataObject {
 
     // Exclude fields yet not added by pending upgrades
     $dbVer = \CRM_Core_BAO_Domain::version();
-    if ($fields && version_compare($dbVer, \CRM_Utils_System::version()) < 0) {
+    $daoExt = constant(static::class . '::EXT');
+    if ($fields && $daoExt === 'civicrm' && version_compare($dbVer, \CRM_Utils_System::version()) < 0) {
       $fields = array_filter($fields, function($field) use ($dbVer) {
         $add = $field['add'] ?? '1.0.0';
         if (substr_count($add, '.') < 2) {
-- 
2.25.1