为什么我收到验证错误?

时间:2013-04-25 17:25:55

标签: drupal-6

在节点编辑页面的文件附件下,单击附加时出现以下错误: 验证错误,请重试。如果此错误仍然存​​在,请与网站管理员联系

1 个答案:

答案 0 :(得分:0)

更多的权宜之计,或许:我禁用了javascript足够长时间来执行我的文件上传,然后将其重新打开。

对于我遇到此错误的安装,模块路径上的递归grep在以下路径中显示此错误消息:

modules/upload/upload.module
includes/form.inc
sites/all/modules/ctools/includes/form.inc
sites/all/modules/views/includes/form.inc

我在文件上传过程中遇到错误,快速查看upload.module显示错误来自名为upload_js()的函数。所以我在浏览器中禁用了javascript并上传了我的文件,然后重新启用了javascript。

在此之前,我确保我的用户拥有权限和足够的配额来上传此< 400kb文件,突然max_file_uploads设置并重新启动php5-fpm/apache

抱怨代码如下:

  // Load the form from the Form API cache.
  if (!($cached_form = form_get_cache($_POST['form_build_id'], $cached_form_state)) || !isset($cached_form['#node']) || !isset($cached_form['attachments'])) {
    form_set_error('form_token', t('Validation error, please try again. If this error persists, please contact the site administrator.'));
    $output = theme('status_messages');
    print drupal_to_js(array('status' => TRUE, 'data' => $output));
    exit();
  }