Breaks CCK Nodereference Autocomplete Fields
| Project: | Big Autocomplete TAXonomy |
| Version: | 6.x-1.6 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
With Batax enabled, if I edit a node that also has a CCK Nodereference > Autocomplete field, regardless of what that field's content should be, I have ' [nid:Array]' in the textfield and the link to the originally referred node is broken. It also added an extra box, as the cardinality is one-to-many; note in the screenshot the icons to the right of the text box are from noderelationships.
I thought it may have been a problem with Noderelationships but this does not appear to be the case.
Trying a few other JS things out - I tried moving $scripts around - trying it both in the HEAD and at the end of the HTML. This had no effect. So currently have disable Batax :(
Great module, but not sure anyone else is seeing this problem. The only thing that seems to be in common between the Taxonomy and CCK text boxes is the CSS class 'form-autocomplete.' Is this problem down to a jQ naming issue?
| Attachment | Size |
|---|---|
| broken-cck-field.png | 7.88 KB |

#1
I also get the [nid:Array] after enabling Batax. In addition, I get an autocomplete error (see image). I´m trying to find out what exactly causes this...
I get the autocomplete error only with the Devel modul enabled.
#2
Alas I'm seeing the [nid:Array] problem regardless of the status of the Devel module.
However with Devel enabled I have exactly same problem as reported by @mikekasky. (This is related to another autocomplete error I see with Location module - only remedied by disabling Devel... #429236: States/Providence Auto Complete error..)
#3
We are having this problem as well. It breaks a couple of other javascript modules (that we built ourselves) on the node edit form as well.
-Daniel
Taxi Bucuresti
#4
Hello,
I have the same issue and found the culprit to be the use of $form_state['storage'] in hook_form_alter - line 68
<?php$form_state['storage']['batax'][$vid] = $vid;
?>
I commented that line and also changed some code in function batax_node_submit($form, &$form_state){} - line 118:
<?php// changed
foreach($form_state['storage']['batax'] as $vid){
//to
foreach($_POST['taxonomy'] as $vid => $val){
?>
Note that:
<?phpunset($form_state['storage']['batax']); // @line 123
?>
is no longer needed with this fix.
The [nid:Array] problem seems to be fixed but I don't like the use of $_POST. We may need a different approach.
#5
@vladrm - would you be prepared to roll a patch? From what you stated above I tried it with line 68 commented out... line 123 should also be commented out too.
I'm not much of a PHP codehead, so not sure of the implications of using $_POST. However, thanks for working out the problem seems to work for me and does not interfere with other autocomplete text fields
#6
Now I've got BATAX working (to a certain degree), I've now realized that if you have multi-value vocabularies, BATAX kills them off. Not sure if it's due to the code changes at #4, or something more fundamental, so I've posted a fresh issue at #579464: BATAX breaks other vocabulary selections.
I think this module is great, but its current functionality is pretty broken, so it would be good to break out a DEV version. I've also changed the status as I think VladRM's code needs review... but the whole module could do with a bit more work too.
#7
Apologies folks, I've only just seen this. Let me have a play around with this tomorrow, although I suspect the issue may actually lie with the node reference module.
As for the Devel module and the autocomplete field, the official fix for that is to turn off the Devel module!