Follow-up to #1567232: API improvements for Variable Realm..

After saving a form, information from the "realm selector" is lost, i.e. the user is redirected to the editing form for the default/current realm key.

For example:

  1. Enable i18n_variable, at least two languages, and configure site slogan to be multilingual
  2. Navigate to the site information settings form at admin/config/sytem/site-information
  3. Select a different language underneith "There are multilingual variables in this form"; (e. g. if current language is English, select German).
  4. Change a value and click save.
  5. You are redirected to the form with English values, even though German was selected before submission.

The initial patch solved this via the following snipped (not sure where exactly it would have to go in the current architecture...):

// Make sure the form shown after submission is still the same one
$query_params = array();
foreach ($variables as $name => $realm) {
  $query_params[VARIABLE_REALM_SELECTOR_QUERY_PARAM_PREFIX . $realm] = $realms_current[$realm];
}
$form_state['redirect'] = array(current_path(), array('query' => $query_params));

Comments

Jose Reyero’s picture

Status: Active » Fixed

Done, similar to the code here, see commit 0bddf855ce40d40ad0c062d6c1582041343144ae

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.