Hi,

i have install the module ubercart order node.
The embedded content type have a file upload for images.
the node is constructed after a new order.
if i upload a file in the order, i have an error message: "An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again."
When i upload a file directly in the content type node it works fine.

regards,
coscha

Comments

m.stenta’s picture

Thanks for the bug report. I haven't tried a FileField or ImageField with this module yet.

I'll try to get to the bottom of this next time I have a chance. In the meantime, if you have programming experience and feel like debugging, I found this: http://drupal.org/node/500646

I haven't read through it yet myself, but it's probably a good place to start.

Can you tell me a little more about your setup so I can be sure to replicate it?
Is it a FileField or an ImageField?
What version of FileField, ImageField, Drupal, Ubercart are you using?

Coscha’s picture

Sorry for my delay time ... i whas a little bit out of order.

I have a datafield -> Image

Drupal Version:
Drupal 6.19

Ubercard Version:
Cart 6.x-2.4
Order 6.x-2.4

CCK Version:
Content 6.x-2.8
Fieldgroup 6.x-2.8
FileField 6.x-3.7
ImageField 6.x-3.7

thx for help and sorry for my bad english.

m.stenta’s picture

Hey I'm digging into this a little, and I can definitely replicate the error.

There are a number of reports of similar errors in the FileField issue queue:

http://drupal.org/node/539476
http://drupal.org/node/795004
http://drupal.org/node/435318

Most seem to be a result of caching problems. But that's not the case with this issue, because it happens even with all caching turned off.

The error comes from line 587 of filefield.module, in the filefield_js() function, which is a page callback with the following description:

/**
 * Menu callback; Shared AHAH callback for uploads and deletions.
 *
 * This rebuilds the form element for a particular field item. As long as the
 * form processing is properly encapsulated in the widget element the form
 * should rebuild correctly using FAPI without the need for additional callbacks
 * or processing.
 */
function filefield_js($type_name, $field_name, $delta) {

The error takes place in this chunk of code:

  // Build the new form.
  $form_state = array('submitted' => FALSE);
  $form_build_id = $_POST['form_build_id'];
  $form = form_get_cache($form_build_id, $form_state);

  if (!$form) {
    // Invalid form_build_id.
    drupal_set_message(t('An unrecoverable error occurred. This form was missing from the server cache. Try reloading the page and submitting again.'), 'error');
    print drupal_to_js(array('data' => theme('status_messages')));
    exit;
  }

So it appears that when you select a file for upload, and click the "Upload" button, FileField fires off an Ajax request to this function (filefield_js()) to rebuild it's part of the form. The $form_build_id that it's passing in, however, is not valid.

My understanding of the Form API's caching is not that great, so I'll need to look deeper to figure out what should be happening. If anyone else has a better understanding, your input is welcome!

remco75’s picture

Strange addidtion to this discussion:

I had the same problem with the cache disabled. After lot's op experimentation I found out the the issue was caused by having a OpenLayers CCK field appearing before the filefield.

When I positioned the filefield after the openlayers field the errors went away.

Perhaps a poorply implemented javascript / ahah implementation by one of the modules.