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.
I noticed that exported nodes are missing the initial indentation, e.g.:
function myfeature_content_defaults() {
$content = array();
$content['about'] = (object)array(
'exported_path' => 'about',
'link' => array(
'menu_name' => 'main-menu',
'link_path' => 'node-name/about',
'router_path' => 'node/%',
'link_title' => 'About',
'options' => array(),
'module' => 'menu',
'hidden' => '0',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-6',
'identifier' => 'main-menu:node-name/about',
),
'title' => 'About',
'status' => '1',
'promote' => '0',
'sticky' => '0',
'type' => 'category',
'language' => 'und',
'created' => '1304655430',
'comment' => '1',
'translate' => '0',
'machine_name' => 'about',
);
return $content;
}
This should instead be:
function myfeature_content_defaults() {
$content = array();
$content['about'] = (object)array(
'exported_path' => 'about',
'link' => array(
'menu_name' => 'main-menu',
'link_path' => 'node-name/about',
'router_path' => 'node/%',
'link_title' => 'About',
'options' => array(),
'module' => 'menu',
'hidden' => '0',
'external' => '0',
'has_children' => '0',
'expanded' => '0',
'weight' => '-6',
'identifier' => 'main-menu:node-name/about',
),
'title' => 'About',
'status' => '1',
'promote' => '0',
'sticky' => '0',
'type' => 'category',
'language' => 'und',
'created' => '1304655430',
'comment' => '1',
'translate' => '0',
'machine_name' => 'about',
);
return $content;
}
Comment | File | Size | Author |
---|---|---|---|
#3 | initial-indentation-1148758-3.patch | 1.4 KB | rvilar |
#1 | defaultcontent-n1148758.patch | 1.24 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaA quick patch to improve the indentation.
This work sponsored by Bluespark Labs.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedTested the patch and it works. I think this can be committed.
Comment #3
rvilarAccordingly to Drupal coding standards, you have to leave an space between the concatenation operator.
Comment #4
pcho CreditAttribution: pcho commented@DamienMcKenna, rvilar
Thank you for your contributions. After reviewing the changes, I applied your patch to the repo for next release. I will declare this issue as fixed.