私のページには次のコードがあります。
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 行目)。