Skip to content
Snippets Groups Projects
Commit edab8a3b authored by Julian Pustkuchen's avatar Julian Pustkuchen
Browse files

Improved status messages for missing libraries.

parent ba7099b0
No related branches found
Tags 4.1.32
No related merge requests found
......@@ -21,10 +21,10 @@ function drowl_paragraphs_type_countdown_requirements($phase) {
'title' => t('DROWL Paragraphs Type: Countdown'),
'value' => t('@e: At least @a', [
'@e' => $error_type,
'@a' => '0.3',
'@a' => 'v0.3',
]),
'severity' => REQUIREMENT_ERROR,
'description' => t('@error You need to download the <a href=":url">Flipdown library</a>, extract the archive and place it in the the %path directory on your server. Ensure the following files to exist: "/libraries/flipdown/dist/flipdown.min.js", "/libraries/flipdown/dist/flipdown.min.css". You may use ´composer require npm-asset/flipdown´', [
'description' => t('@error You need to download the <a href=":url" target="_blank">Flipdown library</a>, extract the archive and place it in the the %path directory on your server. Ensure the following files to exist: "/libraries/flipdown/dist/flipdown.min.js", "/libraries/flipdown/dist/flipdown.min.css". Alternatively use ´composer require npm-asset/flipdown´.', [
'@error' => $error_message,
':url' => 'https://github.com/PButcher/flipdown',
'%path' => 'libraries',
......
......@@ -14,17 +14,17 @@ function drowl_paragraphs_type_score_requirements($phase) {
$library_definition = \Drupal::service('library.discovery')->getLibraryByName('drowl_paragraphs_type_score', 'global');
$library = [];
if (!file_exists(DRUPAL_ROOT . '/' . $library_definition['js'][0]['data']) || !file_exists(DRUPAL_ROOT . '/' . $library_definition['css'][0]['data'])) {
$error_type = t('Missing flipdown library');
$error_type = t('Missing progressbar.js library');
$error_message = t('Library not found in the "libraries" directory.');
if (empty($library['installed'])) {
$requirements['drowl_paragraphs_type_score'] = [
'title' => t('DROWL Paragraphs Type: score'),
'value' => t('@e: At least @a', [
'@e' => $error_type,
'@a' => '0.3',
'@a' => 'v1.1',
]),
'severity' => REQUIREMENT_ERROR,
'description' => t('@error You need to download the <a href=":url">progressbar.js library</a>, extract the archive and place it in the the %path directory on your server. Ensure the following file to exist: "/libraries/progressbar.js/dist/progressbar.min.js". You may use ´composer require npm-asset/progressbar.js´!', [
'description' => t('@error You need to download the <a href=":url" target="_blank">progressbar.js library</a>, extract the archive and place it in the the %path directory on your server. Ensure the following file to exist: "/libraries/progressbar.js/dist/progressbar.min.js". Alternatively use ´composer require npm-asset/progressbar.js´.', [
'@error' => $error_message,
':url' => 'https://github.com/kimmobrunfeldt/progressbar.js',
'%path' => 'libraries',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment