Commit c9c86ebf authored by Gábor Hojtsy's avatar Gábor Hojtsy

#145251 by chx: document that one needs to include the proper 'op' value in...

#145251 by chx: document that one needs to include the proper 'op' value in arrays passed to drupal_execute() to trigger the right action
parent 5d1c8889
...@@ -191,6 +191,7 @@ function form_set_cache($form_build_id, $form, $form_state) { ...@@ -191,6 +191,7 @@ function form_set_cache($form_build_id, $form, $form_state) {
* $form_state['values']['name'] = 'robo-user'; * $form_state['values']['name'] = 'robo-user';
* $form_state['values']['mail'] = 'robouser@example.com'; * $form_state['values']['mail'] = 'robouser@example.com';
* $form_state['values']['pass'] = 'password'; * $form_state['values']['pass'] = 'password';
* $form_state['values']['op'] = t('Create new account');
* drupal_execute('user_register', $form_state); * drupal_execute('user_register', $form_state);
* *
* // Create a new node * // Create a new node
...@@ -199,6 +200,7 @@ function form_set_cache($form_build_id, $form, $form_state) { ...@@ -199,6 +200,7 @@ function form_set_cache($form_build_id, $form, $form_state) {
* $form_state['values']['title'] = 'My node'; * $form_state['values']['title'] = 'My node';
* $form_state['values']['body'] = 'This is the body text!'; * $form_state['values']['body'] = 'This is the body text!';
* $form_state['values']['name'] = 'robo-user'; * $form_state['values']['name'] = 'robo-user';
* $form_state['values']['op'] = t('Save');
* drupal_execute('story_node_form', $form_state, $node); * drupal_execute('story_node_form', $form_state, $node);
*/ */
function drupal_execute($form_id, &$form_state) { function drupal_execute($form_id, &$form_state) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment