Skip to content
Snippets Groups Projects
Commit 36b2dec8 authored by colemanw's avatar colemanw
Browse files

PseudoConstant - Prevent fatal when entity not available

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
parent d0467ab1
Branches
Tags
No related merge requests found
......@@ -208,8 +208,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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment