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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ahwebd’s picture

unic’s picture

"solve_hs_issues.tar_.gz" from header worked for me. Solved node duplication on term creation.

Athos’s picture

I 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

Athos’s picture

Thanks..So far it works for me as well!

rwilson0429’s picture

I would like to test this as well. So, what did you do with the two files to get it to work for you? Thanks.

radoo’s picture

Good
it works for me

sixelats’s picture

Module 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.

rwilson0429’s picture

Module 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.

rimen’s picture

It work for me!
Thanks!

amaria’s picture

This 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.

unic’s picture

Same problem when install mollom:

Error: Only variables can be passed by reference

Thanks amaria for solution in #10.

amaria’s picture

I 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);

parvanova’s picture

What 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

parvanova’s picture

Also

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

jphelan’s picture

Issue summary: View changes

Downgrading to 7.x-3.0-alpha5 and installing the solve_hs_issues module above worked for me.

suburbanmarx’s picture

Followed same procedure as in #15- downgraded and installed solve_hs_issues. So far no issues.

stefan.r’s picture

Status: Active » Closed (won't fix)

In 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.