Is it possible to to invoke a rule this way?

So far I have not had any luck?

/* Implementation of hook_form_alter*/

function login_auth_form_alter(&$form, $form_state, $form_id) {

  if ($form_id == 'user_login') {

  $form['#validate'][] = 'ea_login'; 
  }
}

/* implementation of hook_form_validate */

function ea_login($form, &$form_state) {

  $response = rules_invoke('rules_my_rule', $args);
}

Comments

duit’s picture

This works

/* Implementation of hook_form_alter*/

function login_auth_form_alter(&$form, $form_state, $form_id) {
  
	if ($form_id == 'user_login') {
  
			$form['#validate'][] = 'ea_login';
		}
	}

/* implementation of hook_form_validate */
function ea_login($form, &$form_state) {
	
		$response = "SUCCESS message";	
		 rules_invoke_component('rules_display_a_message',$response);
}
TR’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)