I've got code like that:


		$txn = new Transaction();

		// printing all errors in drupal-like form
		set_error_handler(create_function('$errno,$errstr,$errfile,$errline','drupal_set_message($errstr);'));

		// or simply tring to print any message		
		drupal_set_message('Hello word!');

		$results=module_invoke_all('name');

                // other code

If I have and error in hook_name no message will displayed. If I comment

// $txn = new Transaction();

then errors and message will be displayed correctly.

Do you know, why it happens? Hot to solve it?

Comments

dealancer’s picture

Forgot to mention, in other code I've got:

        $result=true;
        foreach ($results as $res)
        	$result=$result && $res;
        if ($result) {
        	 // some code
        } else {
        	$txn->rollback();
	}
	drupal_goto("somewhere");

I've read the drupal_goto saves not shown messages generated by drupal_set_message in db.

manuel.adan’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

It was related to the old module scope.