1

I'm using i18_variable, and I'm using the hook_variable_info, hook_variable_group_info....I enabled the custom variables I defined after that from the admin/config/regional/i18n/variable page.

But I'm getting this error on the variable configuration page in the module

There are conflicting realm variables in the form. The variable New Name is enabled for more than one realm. Review your realm settings

Any particular reason on what could be triggering it?

Here is the relevant code.

function embed_form_menu() {

    $items = array();
    $items['embed-form-configuration'] = array(
        'page callback' => 'drupal_get_form',
        'page arguments' => array('get_embed_form_configuration'),
        'access arguments' => array('Embed Form Configuration Permission'),
        'access callback' => TRUE
      );
    return $items;
}

function get_embed_form_configuration() {
  return drupal_get_form('variable_module_form', 'embed_form');
}

function embed_form_variable_info($options) {

  $variable['embed_form_newname'] = array(
    'title' => t('New Name', array(), $options),
    'description' => t('Enter your new name, please.', array(), $options),
    'type' => 'string',
    'default' => t('Drupal user', array(), $options),
    'group' => 'embed_form',
    'localize' => TRUE,

  );

  return $variable;
}


/**
 * Implements hook_variable_group_info().
 */
function embed_form_variable_group_info() {
  $groups['embed_form'] = array(
    'title' => t('Embed Form'),
    'description' => t('Embed Form Config'),
    'access' => 'Embed Form Configuration Permission',
    'path' => array('admin/config/system/embed-form'),
  );
  return $groups;
}

function get_embed_form_configuration() {
  return drupal_get_form('variable_module_form', 'embed_form');
}
0

Found the fix thanks to some help from @piyuesh

  $items['embed-form-configuration'] = array(
    'page callback' => array('get_embed_form_configuration'),
    'access arguments' => array('Embed Form Configuration Permission'),
    'access callback' => TRUE
  );

It was silly in hindsight, as my page callback was a drupal get form, and in the callback function I was returning a drupal get form as well. THat is why multiple realms.

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.