projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6c94a2
)
PseudoConstant - Prevent fatal when entity not available
author
colemanw
<coleman@civicrm.org>
Thu, 7 Sep 2023 17:38:12 +0000
(13:38 -0400)
committer
colemanw
<coleman@civicrm.org>
Thu, 7 Sep 2023 18:37:40 +0000
(14:37 -0400)
This can happen e.g when Views tries to lookup an option value for a disabled extension.
See https://github.com/civicrm/civicrm-drupal/pull/656#issuecomment-
1094362139
CRM/Core/PseudoConstant.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Core/PseudoConstant.php
b/CRM/Core/PseudoConstant.php
index 17dd76dbe1fb81d4d794bf29ad579005a10812b3..4a86234f1f837fc7b9964b93c44428b2c00103cf 100644
(file)
--- a/
CRM/Core/PseudoConstant.php
+++ b/
CRM/Core/PseudoConstant.php
@@
-209,8
+209,10
@@
class CRM_Core_PseudoConstant {
}
// Core field: load schema
- $dao = new $daoName();
- $fieldSpec = $dao->getFieldSpec($fieldName);
+ if (class_exists($daoName)) {
+ $dao = new $daoName();
+ $fieldSpec = $dao->getFieldSpec($fieldName);
+ }
// Return false if field doesn't exist.
if (empty($fieldSpec)) {