Closed (fixed)
Project:
Drupal Contact List Importer
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2009 at 21:41 UTC
Updated:
11 Nov 2009 at 02:20 UTC
I'd like to have dcl_importer_invite as one of steps after creating account.
So I'd like to set a path where the user would go after submit Send Invite Request button.
Now it's just staying on the same page...
Where in the code I can change / add it ?
Comments
Comment #1
hadsie commentedEasiest way to do it is to override hook_import_action() and return the URL on the submit operation.
something like:
Where $redir_url is the url you want to redirect to. I haven't tested that but hopefully it works. :)
Comment #2
benone commentedHey, thank you.
Can I ask for example ?
I understand it should be placed in template.php ?
Please, provide an example if you can..
Comment #3
benone commentedI would like to paste this line:
$form_state['redirect'] = 'some/other/path';
..somewhere into the module.. but where ? :)
Comment #4
hadsie commentedyeah, the hook i suggested allows you to do just that. that way you don't need to ever modify the module code which would break your upgrade path.
You need to create your own module if you haven't already. And then you can just add the code snippet above into your .module file and change the "mymodule" part of the function definition to the actual name of your module.
Comment #5
benone commentedThanks hadsie !
And it will know that it's the form from dcl_importer ?
Where is the info about dcl_importer module in that code snippet ?
Many thanks again.
Comment #6
hadsie commentedahh yeah, it doesn't need any additional information. the dcl_importer module declares a hook call hook_import_action(), when you create the function called mymodule_import_action() drupal will find the hook and evaluate it when it's suppose to. The key is really in the name of the function.
Comment #7
benone commentedI am doing it right now.
The last question: where shuold I put a path to go after submit ?
return $redir_url; change to return 'user/%uid/edit'; ?
Comment #8
hadsie commentedexactly. obviously %uid would need a valid uid though.
Comment #9
benone commentedWorks perfect like that ! :)
Many thanks.
Comment #10
hadsie commentedawesome! :)
Comment #11
benone commentedOk, I don't expect the answer for this question , coz I already had my last ... :)
If you are still there ...
How to add the link "Skip this step" next to the 'Get My Contacts' button ?
Can I do it also not hacking the module ?
Comment #12
hadsie commentedThe easiest way would probably be to use hook_form_alter in your module and add the link to the form... http://api.drupal.org/api/function/hook_form_alter/6
Comment #13
benone commentedI don't understant those alters. Have no idea how it works.... I know it's probably easy but I always hack the modules, coz don't know how is possible to put something to the module ant in the same time not putting it... :) arggghh
I did like that in openinviter_engine.module file:
After:
I put:
And it's working :)
Would you show me the same using this hook_form_alter ?
Comment #14
benone commentedOk, I learned it. Now understand.
Thanks for your hints !
:)
Comment #15
hadsie commentedawesome! :)