When I use image_fupload in a node type containing an autocomplete node reference field, entering any title in the node reference field leads to a "found no post with that title" error to be displayed on the page (immediately via AJAX/AHAH).

It looks as if entering text into the autocomplete field may actually be triggering something in the swfupload widget, because the image_fupload progress bar image displays briefly on screen before the error is displayed.

The error is displayed even if the node being referenced actually exists (i.e., if you select from the options provided by the autocomplete field.) But the error is false -- you can upload images and submit the node and everything will work fine.

Tested on: Flash 9, Firefox 3.0.8, Drupal 6.10, PHP 5.2, MySQL 5, Apache 2.

Comments

grandcat’s picture

Category: bug » support

There should be no conflicts. I tested it all the time and there's no problem. I think that something other might be corrupt:
Try to disable FUpload widget and check the node reference field again. If it doesn't work either, the server might be mis-configured or is too restricted.

aasarava’s picture

I restested on a completely clean installation of Drupal 6.10 with the default Garland theme. The problem is still there. But I see that it's only triggered if you press Enter while in an autocomplete field.

If you start typing the title of a node and then press Enter to select the suggested option, it fires the image_fupload widget, which starts processing. And for some reason, this also causes the nodereference field to return the "found no valid post" error.

However, if you type a node title into the autocomplete field, and then click on an option with your mouse, there is no error. It only happens if you press Enter to select the option.

This problem exists when image_fupload is used on the same node form with other autocomplete fields too, like free tag taxonomies. The autocomplete fields do not return the "found no valid post" error when there is no image_fupload field in use on the form.

To test:
1. Install Drupal 6.10
2. Install and enable cck, nodereference, filefield, imagefield, imageapi, imagecache, and image_fupload.
3. Edit the Story content type and add a nodereference field (to nodes of the Page type) with autocomplete widget, and an imagefield with the image_fupload widget.
4. Go create a new Page node. Use "Test" as a title.
5. Go create a new Story node. In the nodereference field, type "Te" ... the autocomplete function will show you the "Test" node title as an option. Use your down arrow to highlight this option and then press Enter. You should see the "found no post with that title" error appear just under the noderef field -- even though the title is valid.

Hope that helps.

grandcat’s picture

OK, you're right, but I can't really fix it because of a bug in the form api. I can't really change the type of all buttons to "button", because they're hardcoded to type "submit". Consequently, independent of the used field, hitting ENTER would submit all AHAH requests.

Changing '#type', '#executes_submit_callback', '#button_type' does not make any difference.