Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By kmlinantud on
ive got this code
function send_xml_form_user_register_form_alter(&$form, &$form_state) {
$form['#submit'][] = 'send_xml_submit_function';
}
function send_xml_submit_function($form, &$form_state){
$string = "alkasklsalksa";
drupal_set_message(t('edit = %string.', array('%string' => $string)), "status");
}
my module name is send_xml, i just want to know if the after registration it will go in the function, so i just used drupal-set_message to output the sample message string... but it is not displaying what did i miss ? any help please...
thank you in advance,, i had a lot of tabs now searching what's the problem...
Comments
module is enabled ?
Please check once whether send_xml module is enabled or not.
Clear Cache
Check if module is enabled or not , also check after clearing cache as new hook will not effect if cache is not cleared after implement.
it's enabled
thanks for your responses! :)
the module is running fine.
the problem is in because i use the registration form in colorbox. and it does not display the message. maybe some complications. but if i go to the url `mywebsite/custom_registration_link/` its running fine now.
ive got new problem though.
in the custom_submit_handler, ive got
i want to redirect to `myurl` with some parameters, ive been searching for quite 3 days and i came up unto this code. the problem is it is not redirecting to `myurl`
thank you again for your future responses,
Use drupal_goto for redirect
not_good
that was quick reply.. :) thanks.
though.
i used this already, and it is not working.. AAND i've searched for quite a while and i found out the it is not good to put
drupal_goto
in your custom_submit_handler, because there still might be other actions after the submit that might break. so they said to use$form_state['redirect']
instead..try this
yes, drupal_goto() is not good to use in forms.
Try drupal_redirect_form($form_state);
so. basically
i will call
drupal_redirect_form($form_state);
inside my custom_submit handler after setting$form['redirect']
?yes
yes
still not good
still not good. ain't redirecting at all. but the page refreshes, i put a drupal_set_message just to see if it is going in my function, and yes it is but ain't redirecting.
aargh, it is so hard to debug..
Works fine at my end
try the following code and do clear cache
difference
the difference in our code is the commas at the end... do you think that's the reason?
ill try your code.. ill be back to say if it worked.. big thanks!!
P.S. i clear my cache everytime i chage any code in my module just to make sure. :)
yes
the last comma is causing problem
not_good
@Ujwal P
still not working.. how can i debug this? is there a way to debug? to see what is running, what is not?
using
Using colorbox ?
colorbox-node
colorbox, like a lightbox, a simple module that will have a popup effect :)
https://drupal.org/project/colorbox
i dont use it anymore, i just go to the registration page myself. then register.
Use ctools
use cools for popup effect.
FYI: http://deeson-online.co.uk/labs/insert-form-pop-modal-ctools-and-drupal-7
Thank you very much, the link
i liked to use that sooner or later after this redirection works.. haha :)