After disabling JavaScript in my browser, clicking on 'Add' to add a term or 'Update' to refresh the taxonomy list submits the form. This happens both on the node create form, as well as the 'preview' on the vocabulary edit form. It looks to me like these buttons are being defined correctly in hierarchical_select_process(), but they are submit types when rendered on the page.
hierarchical_select.module, line 598
$element['hierarchical_select']['dropbox_add'] = array(
'#type' => 'button',
'#value' => t('Add'),
'#attributes' => array('class' => 'add-to-dropbox'),
);
hierarchical_select.module, line 636
$element['nojs']['update_button'] = array(
'#type' => 'button',
'#value' => t('Update'),
'#attributes' => array('class' => 'update-button'),
);
Any ideas? This is a blocker for me, and I don't have time to debug further.
Comments
Comment #1
wim leersI have no idea how that could happen :S
Especially because exactly the same code flow is used when JS is enabled: those buttons are pressed then, too. It must be the submit handlers, but it's been working fine for so long …
Can you reproduce this on a vanilla Drupal site? If you cannot, keep on adding modules that you're using on your actual site until the problem is reproduced.
When you're able to reproduce this (on a vanilla Drupal site with the minimum number of modules to reproduce it), then please make a screencast of:
That makes it easier for me to reproduce the problem. Thanks!
P.S.: don't have any screencast software yet? On Windows and Mac OS X, you can use the free Jing.
Comment #2
wim leersI bet this is caused by http://drupal.org/node/621956#comment-2400440.
Can you do a fresh Drupal 6.13 install and then try to reproduce the problem? That would give a more definitive answer.
Comment #3
dinknaround commentedFYI...I ran into same issue today. Fresh D6 install, d6 core mods enabled. HS mod only one added on. When creating new node, and javascript disabled, clicking on "add" after selecting a term automatically saves the node.
Comment #4
dinknaround commentedA bit more FYI...the only two HS mods I have enabled are HS and HS Taxonomy. Again, javascript disabled, selecting "add" or "update" (depending on HS Dropbox Settings enabled or not), this issue also occurs on the edit vocabulary pages.
Wondering if HS's form item "$element['nojs']['update_button']" has a callback function or not to rebuild the form? I haven't found it yet. Could this be the reason? Also to humbly admit, I'm still learning Drupal forms api, so I could be wrong. Drupal's core Pole module has code for no js as a good example (I think).
Comment #5
wim leersCould you please make a screencast of the problem being reproduced. That makes it easier for me to understand the problem. Thanks!
P.S.: don't have any screencast software yet? On Windows and Mac OS X, you can use the free Jing.
Comment #6
wim leersClosing due to lack of response. Feel free to reopen!
Comment #7
adrinux commentedRe-opening and slight change of title.
I have a site where the 'Add' button is submitting the node! That's with javascript enabled.
The same page has the admin_menu, imagefield image upload widget and tinymce along with HS, I suspect some sort of collision.
Versions:
admin_menu 6.x-3.x-dev
imagefield 6.x-3.2
Wysiwyg 6.x-2.1 with TinyMCE 3.3.2
jQuery update 6.x-2.x-dev with jQuery 1.3.2
Hierarchical Select & Hierarchical Select Taxonomy 6.x-3.0 enabled
Cache disabled, Optimize JavaScript files disabled.
Just trying to fill out the picture with this post. I'm off to play with enabling/disabling modules and performance options.
Tried looking for error messages in webkit's inspector with nothing apparently wrong. Any suggestions for resources on debugging javascript would be welcome.
Comment #8
wim leersTry disabling:
- Wysiwyg 6.x-2.1 with TinyMCE 3.3.2
- jQuery update 6.x-2.x-dev with jQuery 1.3.2
I bet it's either one of those.
Comment #9
adrinux commentedActually I can't replicate this. Though there are other problems, but those deserve another issue. Closing for now.
Comment #10
Soren Jones commentedHere is some more information on reproducing the issue.
Drupal 6.19
CCK 6.x-2.8
Content Taxonomy 6.x-1.0-rc2
Hierarchical Select 6.x-3.6
*Dropbox enabled
With javascript disabled, clicking on Add submits the node.
With javascript enabled, after clicking "Add another item" for a CCK field with Number of values set to Unlimited, clicking on Add submits the node.
Comment #11
Soren Jones commentedClarifying the title and changing the version. Happy to help however I can.
Comment #12
Soren Jones commentedOops. Forgot the or...
Comment #13
wim leersSee the updated project page: