Skip to content
Snippets Groups Projects
Commit c657d3e7 authored by eileen's avatar eileen :8ball: Committed by GitHub
Browse files

Merge pull request #8343 from coldrunKacper/skip-components-in-disabled-extensions

'Components inside disabled Extensions' issue fix.
parents 4ff2526e ca1e39b1
Branches
Tags
No related merge requests found
......@@ -99,7 +99,11 @@ class CRM_Core_Component {
$cr->find(FALSE);
while ($cr->fetch()) {
$infoClass = $cr->namespace . '_' . self::COMPONENT_INFO_CLASS;
require_once (str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php');
$infoClassFile = str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php';
if (!CRM_Utils_File::isIncludable($infoClassFile)) {
continue;
}
require_once $infoClassFile;
$infoObject = new $infoClass($cr->name, $cr->namespace, $cr->id);
if ($infoObject->info['name'] !== $cr->name) {
CRM_Core_Error::fatal("There is a discrepancy between name in component registry and in info file ({$cr->name}).");
......
......@@ -64,13 +64,16 @@ class CRM_Core_OptionValue {
* @param array $groupParams Array containing group fields whose option-values is to retrieved.
* @param string $orderBy for orderBy clause
* @param array $links has links like edit, delete, disable ..etc
* @param bool $skipEmptyComponents
* whether to skip OptionValue rows with empty Component name
* (i.e. when Extension providing the Component is disabled)
*
* @return array of option-values
*
* @access public
* @static
*/
static function getRows($groupParams, $links, $orderBy = 'weight') {
static function getRows($groupParams, $links, $orderBy = 'weight', $skipEmptyComponents = TRUE) {
$optionValue = array();
$optionGroupID = NULL;
......@@ -118,6 +121,13 @@ class CRM_Core_OptionValue {
while ($dao->fetch()) {
$optionValue[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $optionValue[$dao->id]);
if (!empty($optionValue[$dao->id]['component_id']) &&
empty($componentNames[$optionValue[$dao->id]['component_id']]) &&
$skipEmptyComponents
) {
unset($optionValue[$dao->id]);
continue;
}
// form all action links
$action = array_sum(array_keys($links));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment