When using this module in an install profile I get the following error:
Warning: array_merge(): Argument #2 is not an array in drupal_check_profile() (line 1188 of [...]/includes/install.inc).
This is because phpwkhtmltopdf_requirements() returns nothing (NULL) for any other phase than runtime.
hook_requirements currently looks like this:
/**
* Implements hook_requirements().
*/
function phpwkhtmltopdf_requirements($phase) {
// We only care to run our requirements validation on the "runtime" phase.
switch ($phase) {
case 'runtime':
$results = array();
module_load_include('module', 'phpwkhtmltopdf');
// Get our own libraries to loop over and verify.
$libraries = phpwkhtmltopdf_libraries_info();
// Loop over the libraries this module defines and need to be verified.
foreach($libraries as $name => $details) {
$lib_results = phpwkhtmltopdf_requirements_validate_library($name, 'phpwkhtmltopdf_failed_generic');
// Merge the results of this library with the previous results, we'll be returned all of them at the end.
$results = array_merge($results, $lib_results);
}
// Return the validation results to Drupal.
return $results;
break;
}
}
but should look like this:
/**
* Implements hook_requirements().
*/
function phpwkhtmltopdf_requirements($phase) {
// We only care to run our requirements validation on the "runtime" phase.
switch ($phase) {
case 'runtime':
$results = array();
module_load_include('module', 'phpwkhtmltopdf');
// Get our own libraries to loop over and verify.
$libraries = phpwkhtmltopdf_libraries_info();
// Loop over the libraries this module defines and need to be verified.
foreach($libraries as $name => $details) {
$lib_results = phpwkhtmltopdf_requirements_validate_library($name, 'phpwkhtmltopdf_failed_generic');
// Merge the results of this library with the previous results, we'll be returned all of them at the end.
$results = array_merge($results, $lib_results);
}
// Return the validation results to Drupal.
return $results;
break;
}
return array();
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | i2486555-3.patch | 793 bytes | attiks |
Comments
Comment #1
jelle_sComment #2
cravecode commentedThanks @Jelle_S, I'll get that updated.
Comment #3
attiks commentedPatch
Comment #5
cravecode commentedThanks for the patch @attiks. You have perfect timing.
The patch is in 2.x-dev and a new release 7.x-2.1 (waiting on the release to propagate).