Had to debug slick.install to figure out what was going on - I had created /sites/libraries/slick and uploaded lib files, but was still getting an error about not having Slick installed properly.
slick.install looks for the slick.min.js file specifically.
Please consider providing better requirements messages for slightly easier troubleshooting!
/**
* Implements hook_requirements().
*
* Checks for the Slick library.
*/
function slick_requirements($phase) {
$t = get_t();
$requirements = array();
// Check for the Slick library.
if ($phase == 'runtime') {
$path = libraries_get_path('slick');
if (!file_exists("{$path}/slick/slick.min.js")) {
$requirements['slick_library'] = array(
'description' => $t('Please ensure <a href="@url">slick.min.js</a> is present at [libraries-path]/slick.', array('@url' => 'https://github.com/kenwheeler/slick/')),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Missing minified script.'),
'title' => $t('Slick library'),
);
}
if (!$path) {
$requirements['slick_library'] = array(
'description' => $t('The <a href="@url">Slick library</a> should be installed at [libraries-path]/slick.', array('@url' => 'https://github.com/kenwheeler/slick/')),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Not installed.'),
'title' => $t('Slick library'),
);
}
// Check for the minimum required jQuery version.
$jquery_version = variable_get('jquery_update_jquery_version', '1.5');
if (!version_compare($jquery_version, '1.7', '>=')) {
$requirements['slick_jquery_version'] = array(
'description' => $t('Incorrect jQuery version detected. Slick requires jQuery 1.7 or higher. Please change your <a href="!settings">jQuery Update settings</a>.', array('!settings' => url('admin/config/development/jquery_update'))),
'severity' => REQUIREMENT_ERROR,
'value' => $t('Not installed. Please enable jQuery 1.7 or higher.'),
'title' => $t('Slick jQuery version'),
);
}
}
return $requirements;
}
Comments
Comment #1
emcniece commentedActually ran in to another PEBCAK issue during this - I had pulled the core /slick/slick/ folder out of the repo zip and dropped it in the libraries folder without realizing that the install reqs are actually looking for the entire slick-master directory. This is just a habit formed from other libraries and installs...
Maybe the requirements description could be updated to show the right path? Instead of:
'description' => $t('Please ensure <a href="@url">slick.min.js</a> is present at [libraries-path]/slick.', array('@url' => 'https://github.com/kenwheeler/slick/')),it could be:
'description' => $t("Please ensure <a href=\"@url\">slick.min.js</a> is present at <strong>{$path}/slick</strong>.", array('@url' => 'https://github.com/kenwheeler/slick/')),This will at least give users a better idea of what kind of folder structure to expect.
Comment #2
gausarts commentedYes, reasonable. Perhaps instructions at README.txt is not enough.
Would you care to provide a patch?
Thanks.
Comment #4
gausarts commentedI changed the approach a bit to avoid extra checks. Hopefully fair enough since all is needed is the more informative path.
Thanks.