Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the example hook_features_export_render()
(in features.api.php,) the second-to-last line tries to implode $mycomponents
, which doesn't exist in the context of the function:
<?php
function hook_features_export_render($module_name, $data, $export = NULL) {
$code = array();
$code[] = '$mycomponents = array();';
foreach ($data as $name) {
$code[] = " \$mycomponents['{$name}'] = " . features_var_export(mycomponent_load($name)) .";";
}
$code[] = "return \$mycomponents;";
$code = implode("\n", $mycomponents);
return array('mycomponent_defaults' => $code);
}
?>
...
It should really be imploding $code
:
- $code = implode("\n", $mycomponents);
+ $code = implode("\n", $code);
Comment | File | Size | Author |
---|---|---|---|
#1 | features-api_export_render_mixup-1564864-1.patch | 495 bytes | jeffschuler |
Comments
Comment #1
jeffschulerComment #2
mpotter CreditAttribution: mpotter commentedEasy one. Committed and pushed to 22502b0.
Comment #3
jeffschulerGreat; thanks for reviewing and committing!
Commit authorship credit is always appreciated, too. :)
Comment #5
kenorb CreditAttribution: kenorb commented