로이 정의되지 않은 배열 인덱스를 제거하는 방법 : 난 그냥 정의되지 않은 오류가 무작위로 그 페이지에 PHP주의로 발생 점점 계속PHP - 목록
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,
);
}
}
}
을 원하는 이 오류를 더 이상 볼 수 없으므로 ... isset()
을 확인하여 정의되지 않은 오류를 해결할 수 있지만 PHP list
언어 구조에서 수행하는 방법을 잘 모르는 경우가 있습니다.
오류는 여기이 선에 발생
list($entity, $bundle, $field_name) = explode('|', $field);
다음과 같이 보여줍니다
주의가 : 오프셋 정의되지 않은 : 2 ds_extras_field_extra_fields에서() (라인의 514/사이트/모든/모듈/ds/모듈/ds_extras/ds_extras.module).
'if (isset (variable_get ('ds_extras_fields_extra'))) {' – Peon
'variable_get' 함수에는 아무런 문제가 없습니다. 수백만 번 사용되어 완벽하게 작동합니다. –