I've written a modified "hierarchical_select_ajax()" function (attached below) which adds mollom captcha to "create new item" box,
It also checks if user input is empty or default (ie "new item") and stops further processing.
The function also prevents adding duplicate terms.
It removes non related errors on ajax operations. (for example the errors displayed when pressing "Create" or "Cancel" buttons)
You can either replace the original function, or use it in a new module that overrides the "page callback" that calls it by implementing hook_menu_alter() (module attached) (note: ensure module loads after hierarchical_select (weight on system table or use a module name that comes after hierarchical_select in the alphabetical order ) )
The module attached also contains a fix that prevents node submit when pressing "Create" or "Cancel" buttons on "create new item" box. See: http://drupal.org/node/1293166#comment-5237076
you can get the module with git:
git clone --branch master http://git.drupal.org/sandbox/ahwebd/1389734.git solve_hierarchical_select_issues
Testing and feedback needed, so we can submit a patch to HS
Comment | File | Size | Author |
---|---|---|---|
solve_hs_issues.tar_.gz | 3.05 KB | ahwebd | |
hierarchical_select_ajax.txt | 11.81 KB | ahwebd |
Comments
Comment #1
ahwebd CreditAttribution: ahwebd commentedproject page http://drupal.org/sandbox/ahwebd/1389734
Comment #2
unic CreditAttribution: unic commented"solve_hs_issues.tar_.gz" from header worked for me. Solved node duplication on term creation.
Comment #3
Athos CreditAttribution: Athos commentedI would like to test as well but i dont know what to do with the two attached files. Possible to guide a little bit ?
Thanks
Athos
Comment #4
Athos CreditAttribution: Athos commentedThanks..So far it works for me as well!
Comment #5
rwilson0429 CreditAttribution: rwilson0429 commentedI would like to test this as well. So, what did you do with the two files to get it to work for you? Thanks.
Comment #6
radoo CreditAttribution: radoo commentedGood
it works for me
Comment #7
sixelats CreditAttribution: sixelats commentedModule seems to work for me too!
For those who don't know how to use the files and want to test the module:
- ignore hierarchical_select_ajax.txt
- download solve_hs_issues.tar_.gz
- decompress it
- rename the file solve_hs_issues.tar_ to solve_hs_issues.tar (remove the _ at the end)
- decompress it
upload the folder in sites/all/modules and enable it as any other module.
Comment #8
rwilson0429 CreditAttribution: rwilson0429 commentedModule appears to work for me too.
@sixelats, thanks for the detail instructions. It was a great help. I think more people will test it now that there are plan instructions for non-coders like myself.
Comment #9
rimen CreditAttribution: rimen commentedIt work for me!
Thanks!
Comment #10
amaria CreditAttribution: amaria commentedThis works but I had a problem enabling it. Perhaps something changed in Mollom but I was getting following error on lines 120 and 189 of this module...
Error: Only variables can be passed by reference
Changing the mollom_get_captcha parameter to a variable fixes it.
Comment #11
unic CreditAttribution: unic commentedSame problem when install mollom:
Thanks amaria for solution in #10.
Comment #12
amaria CreditAttribution: amaria commentedI looked at the parameter for mollom_get_captcha and it is the form state so I changed...
mollom_get_captcha('image');
to
mollom_get_captcha($form_state);
Comment #13
parvanova CreditAttribution: parvanova commentedWhat should I do in order to have mollom captcha in "create new item" box?
I activated HS, solve_hs_issues and Mollom modules and can see captcha in forms where I configured it to be shown.
But how to add it in the form for creating new term?
Thanks
Comment #14
parvanova CreditAttribution: parvanova commentedAlso
I use HS to allow users to select from a vocabulary in both node creation and User registration forms.
On the page for creating a node everything is OK (except that I don't see any captcha as per my previous post)
But on user registration page when I click on "Create new Item" I receive "Received an invalid response from the server".
Nothing in the Resent log entries for Drupal. Nothing in the error log of the server. If I disable the solve_hs_issues module I can add new items. EDIT: there is another Mollom captcha on the user registration form and if I remove it the "create new items" works. But still there is no Mollom captcha in the form for Creating new item.
Please advice what to do
any help is appreciated
Comment #15
jphelan CreditAttribution: jphelan commentedDowngrading to 7.x-3.0-alpha5 and installing the solve_hs_issues module above worked for me.
Comment #16
suburbanmarx CreditAttribution: suburbanmarx commentedFollowed same procedure as in #15- downgraded and installed solve_hs_issues. So far no issues.
Comment #17
stefan.r CreditAttribution: stefan.r commentedIn the end I committed #52 in #1293166: Whole node form is saved instead of widget form, possible data loss in order to solve the "create new item" issue.