Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OEL-2278: Added check for slim_select_library path #217

Merged
merged 3 commits into from
May 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions modules/oe_whitelabel_helper/oe_whitelabel_helper.module
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,21 @@ function oe_whitelabel_helper_field_formatter_settings_summary_alter(array &$sum
]);
}
}

/**
* Implements hook_requirements_alter().
*/
function oe_whitelabel_helper_requirements_alter(array &$requirements): void {
if (isset($requirements['slim_select_library'])) {
$theme_handler = \Drupal::service('theme_handler');
$theme_path = $theme_handler->getTheme('oe_bootstrap_theme')->getPath();
$path = '/' . $theme_path . '/assets/js/slimselect.min.js';
$requirements['slim_select_library'] = [
'title' => t('Slim Select library'),
'severity' => REQUIREMENT_OK,
'value' => t('Library available at :path.', [
':path' => $path,
]),
];
}
}