1

私のページには次のコードがあります。

if (variable_get('ds_extras_fields_extra')) {
    $fields = explode("\n", variable_get('ds_extras_fields_extra_list', FALSE));
    foreach ($fields as $field) {
      $field = trim($field);
      if (!empty($field)) {
        list($entity, $bundle, $field_name) = explode('|', $field);
        $extra[check_plain($entity)][check_plain($bundle)]['display'][$field_name] = array(
          'label' => drupal_ucfirst(str_replace('_', ' ', check_plain($field_name))),
          'description' => drupal_ucfirst(str_replace('_', ' ', check_plain($field_name))),
          'weight' => 0,
        );
      }
    }
}

ページ上の PHP 通知として発生する未定義のエラーがランダムに発生し続けます。このエラーを表示したくないだけです...できれば、未定義のエラーをチェックするだけで修正できますisset()が、php でそれを行う方法がわかりません。list言語構造。

エラーは次の行で発生します。

list($entity, $bundle, $field_name) = explode('|', $field);

そして、次のように示します。

Notice: 未定義のオフセット: ds_extras_field_extra_fields() の 2 (/sites/all/modules/ds/modules/ds_extras/ds_extras.module の 514 行目)。

4

2 に答える 2

0

error_reporting または @ インストラクターはどうですか? http://www.php.net/manual/en/security.errors.php

何も変更したくないので、提案するだけです。実際に使用することはお勧めしません。問題を修正してください:)

于 2014-01-07T11:08:58.223 に答える