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

OEL-2278: Added check for slim_select_library path #217

merged 3 commits into from
May 17, 2023

Conversation

tibi2303
Copy link
Contributor

No description provided.

@tibi2303 tibi2303 linked an issue Mar 29, 2023 that may be closed by this pull request
$theme_handler = \Drupal::service('theme_handler');
$theme_path = $theme_handler->getTheme('oe_bootstrap_theme')->getPath();
$path = '/' . $theme_path . '/assets/js/slimselect.min.js';
if (file_exists($path)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We know the file is there, we put it there, I'd rather check if this message is set, if the module is not enabled, then the message is missing
isset($requirements['slim_select_library'])

$theme_path = $theme_handler->getTheme('oe_bootstrap_theme')->getPath();
$path = '/' . $theme_path . '/assets/js/slimselect.min.js';
if (file_exists($path)) {
unset($requirements['slim_select_library']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather then doing this we should mimic the modules behaviour and set a success message

  $requirements['slim_select_library'] = [
    'title' => t('Slim Select library'),
    'severity' => REQUIREMENT_OK,
    'value' => t('Library available at :path.', [
      ':path' => $path,
    ]),
  ];

@drishu drishu changed the title OEL-2278: Added check for slim_select_library path and removed req if exists. OEL-2278: Added check for slim_select_library path May 17, 2023
@drishu drishu merged commit 3a8d51a into 1.x May 17, 2023
@drishu drishu deleted the OEL-2278 branch May 17, 2023 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect slimselect warning on Status report page
2 participants