When we use drupal_set_message function inside submit hook with english letters all message appears on next screen. But if we use translation to Cyrillic all message are disappear from $_SESSION variable, nor messages displayed.

function some_form_child( $func_id, $is_edit ) {
  modalframe_child_js();

  print_r( $_SESSION ); // debug information

  $form = array();
  return $form;
}

function some_form_child_submit( $form_id, &$form_state ) {
  drupal_set_message( 'test' ); // work perfect
}
/* result after not translated message
$_SESSION = Array
(
    [node_overview_filter] => Array
        (
        )

    [dblog_overview_filter] => Array
        (
        )

    [user_overview_filter] => Array
        (
        )

    [messages] => Array
        (
            [status] => Array
                (
                    [0] => test
                )

        )

)
*/

function some_form_child_submit( $form_id, &$form_state ) {
  drupal_set_message( t('test') ); // doesn't work
}
/* result after use t()
$_SESSION = Array
(
    [node_overview_filter] => Array
        (
        )

    [dblog_overview_filter] => Array
        (
        )

    [user_overview_filter] => Array
        (
        )

    [messages] => 
)
*/

Comments

markus_petrux’s picture

Priority: Critical » Normal
Status: Active » Closed (works as designed)

Modal Frame API does not touch the $_SESSION array, and it merely renders Drupal messages using theme('status_messages') as any other theme, so this issue looks like related to something else.

dimedrol’s picture

Status: Closed (works as designed) » Active

This situation occurs in the standard theme Garland. Using the drupal_set_message () with Cyrillic characters in submit of standard form displays all messages normally. Please check with a withdrawal of non-English characters in the status messages. Can we assume that this may be due to the transfer or recoding messages. For example, can indicate the Russian translation of the word test - "тест". Checking will take you no more than 10 minutes.

markus_petrux’s picture

Status: Active » Closed (works as designed)

Really, I have checked with Garland, and another Zen based theme. Anything that is sent to drupal_set_message() while rendering the child page, or processing submitted forms, work ok here.

I'm not english native, so I tend to test anything with non-ascii characters. Now, I also tested with the string you said above. Still, adding drupal_set_message() by hand in several places with your string and other non-ascii texts, works ok here.

I cannot see what in Modal Frame API could make your site work oddly. I think your issue is caused by something else in your particular installation. For this reason, I believe this issue does not belong to this module, hence I'm telling here "by design".

Sadly, I have no idea what could be causing this issue, otherwise I would be pointing you somewhere more concrete. I think you have to debug your code and check what is really returning t('test'), and/or what is happening with your $_SESSION data.