0

In my Feature I wanted to add the multilingual path_breadcrumbs_home_link_title for en and de, but when generating the feature by including the realm_variables there is the site_name and site_slogan in the en array included too.

The site_name is a mandatory field, so I can not just leave it empty.

The generate file looks like this:

<?php

/**
 * Implements hook_variable_realm_default_variables().
 */
function foo_variable_realm_default_variables() {
  $realm_variables = array();
  $realm_variables['language']['de'] = array(
    'path_breadcrumbs_delimiter' => '»',
    'path_breadcrumbs_home_link_title' => 'Startseite',
  );
  $realm_variables['language']['en'] = array(
    'path_breadcrumbs_delimiter' => '»',
    'path_breadcrumbs_home_link_title' => 'Home',
    'site_name' => 'Demo Site',
    'site_slogan' => '',
  );
  return $realm_variables;
}

The site name would overwrite all the site names of any already deployed Drupal site.

I don't understand why it doesn't appear in the de array even while site name is set there too.

How can I get rid of this?

Any workarounds?

1

The hook_features_export_alter would allow you to alter the final array of Component names to be exported, just prior to the rendering of defaults.

This allows feature modules a final say in whether or not certain Components are exported.

However the Components' actual data cannot be altered by this hook, so I'm not sure if that actually helps.

Example:

function hook_features_export_alter(&$export, $module_name) {
  // Example: do not allow the page content type to be exported, ever.
  if (!empty($export['features']['node']['page'])) {
    unset($export['features']['node']['page']);
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.