필드와 사용자 정의 노드 유형이 hook_install 통해 생성정의되지 않은 인덱스 : locale_field_entity_form_submit에서 field_block_pre_login_body() (D : \ xampp \ htdocs \ projects \ foo \ modules \ locale \ locale.module의 438 행).
사용자 정의 : 내가 드루팔에서 내 사용자 지정 모듈을 설치하고, 내가 생성 한 사용자 정의 노드 유형을 통해 콘텐츠를 추가 한 후에는 이제
function custom_module_install() {
$nodeType = new stdClass();
$nodeType->type = "foo_block";
$nodeType->orig_type = "foo_block";
$nodeType->base = "node_content";
$nodeType->name = "FooBlock";
$nodeType->description = $t("This is a Custom Content Type for Defining Custom blocks for Pre and Post Login State Functionality on blocks");
$nodeType->help = "Use This Content Type only if the block will have a Login State requirements";
$nodeType->custom = TRUE;
$nodeType->has_title = TRUE;
$nodeType->title_label = "Custom Block";
$nodeType->locked = FALSE;
$nodeType->disabled = FALSE;
node_type_save($nodeType);
if (!field_info_field('field_block_pre_login_body')) {
$field = array(
'field_name' => $t('field_block_pre_login_body'),
'type' => 'text_long',
);
field_create_field($field);
// Create the field instance on the bundle.
$instance = array(
'field_name' => $t('field_block_pre_login_body'),
'label' => $t('Pre-Login Body'),
'bundle' => 'matterhorn_block',
'entity_type' => 'node',
'required' => FALSE,
'widget' => array('type' => 'text_textarea'),
'settings' => array('text_processing' => 1),
'format' => 'filter_html',
);
field_create_instance($instance);
}
}
을 locale.module은 해당 내용 유형으로 생성 된 내용을 작성 또는 업데이트 한 후에 오류를 표시합니다. 어떤 문제를 해결할 수 있습니까? 감사!
** 수정 **
참고 :이 드루팔 모듈은 내가 당신이 전화 한 후에는 field_block_pre_login_body
이 인덱스에 만들어지기 때문에 드루팔 필드-API이 함께 작동하는 방법 등 더 자세한 설명이 필요 field_create_field
방법.
가능한 중복 (HTTP : // 유래를 .com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-index) – Phil