3

在此处输入图像描述我在 Drupal 6 网站上工作,虽然我是 Drupal 和 php 的新手。我正在根据现有模块的代码创建一个模块,我收到“致命错误:调用 ..../modules/cck/content.module(1694) 中的未定义函数 ...return_zip_codes() : eval ()'d 代码在第 2 行”错误。发生此错误时,我无法通过 Web 界面访问 drupal 站点。我已经删除了有问题的模块并尝试在此处输入图像描述使用 Drush 清除所有 cac hes 并运行 cron 并使用 mysql 命令行清除缓存表,但错误仍然存​​在。由于错误,运行 drush cron 和 drush cc all 也“中止”。当我用谷歌搜索错误时,我没有得到太多。我附上了我得到的原始错误的屏幕截图。

我在堆栈跟踪上注释掉了一行,并设法恢复了站点,但是当我单击链接注册新成员时出现另一个错误。还注释掉该行导致某些表单与登录页面的某些元素一起显示不正确。

我附上了我得到的错误的打印屏幕以及我编辑的一些代码。如果您需要我提供更多信息和代码,请告诉我。

谢谢

我在第 1694 行的 content.module 文件中注释掉的代码行

enter code here

  $allowed_values[$cid] = array();
if (isset($field['allowed_values_php'])) {
ob_start();
//    $result = eval($field['allowed_values_php']);
if (is_array($result)) {
  if ($flatten) {
    $result = content_array_flatten($result);
  }
  $allowed_values[$cid] = $result;
}
ob_end_clean();
}

我创建的模块中导致错误的代码:

enter code here

    'widget_active' => '1',
'type' => 'text',
'required' => '1',
'multiple' => '0',
'module' => 'text',
'active' => '1',
'text_processing' => 0,
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => 'module_load_include(\'inc\', \'online_![enter image      description here][3]mem_apps\', \'/includes/online_mem_apps.zip_codes\');
return online_mem_apps_return_zip_codes(TRUE);',
'field_permissions' => array(
  'create' => 0,
  'edit' => 0,
  'edit own' => 0,
  'view' => 0,
  'view own' => 0,
),
4

0 回答 0