Notice: Undefined index: label in _field_reference_potential_references_standard() (line 682 of E:\xampp\htdocs\sites\all\modules\field_reference\field_reference.module).

Comments

danielb’s picture

What entity type are you attaching the field to?

kaizerking’s picture

Profile2 profile

kaizerking’s picture

PS: it is attached to field collection field, this filed collection filed is attached to Host entity Profile2 profile

danielb’s picture

I am sometimes told my modules don't work with Field Collection or Profile2. With 107 and 61 open bug issues respectively, I am not entirely convinced that's my fault.

danielb’s picture

well the profile2 hook_entity_info definitely declares a label, so I don't know what's happened

danielb’s picture

any chance you could debug just above where the error happens.

From this:

<?php
      $entity_table = $entity_type_info[$entity_type]['base table'];
      $entity_id = $entity_type_info[$entity_type]['entity keys']['id'];
      $entity_label = $entity_type_info[$entity_type]['entity keys']['label'];
?>

to this:

<?php

      $entity_table = $entity_type_info[$entity_type]['base table'];
      $entity_id = $entity_type_info[$entity_type]['entity keys']['id'];
if (empty($entity_type_info[$entity_type]['entity keys']['label'])) {
  drupal_set_message("<pre>".print_r($entity_type_info[$entity_type], 1));
}
      $entity_label = $entity_type_info[$entity_type]['entity keys']['label'];

?>

and see what message appears (when you normally get that error)

kaizerking’s picture

What I am doing is :
I am creating field reference field in a content type, and then trying to select a Term reference field in field collection field , which has some fields attached to it,the filed I am selecting is a term reference field.
and it is multivalue hierarchical select field:
the result of the debug is here:

Array
(
    [label] => Field collection item
    [label callback] => entity_class_label
    [uri callback] => entity_class_uri
    [entity class] => FieldCollectionItemEntity
    [controller class] => EntityAPIController
    [base table] => field_collection_item
    [fieldable] => 1
    [entity keys] => Array
        (
            [id] => item_id
            [bundle] => field_name
            [revision] => 
        )

    [module] => field_collection
    [view modes] => Array
        (
            [full] => Array
                (
                    [label] => Full content
                    [custom settings] => 
                )

        )

    [access callback] => field_collection_item_access
    [metadata controller class] => FieldCollectionItemMetadataController
    [bundles] => Array
        (
            [field_resume_attachments] => Array
                (
                    [label] => Field collection field_resume_attachments
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-attachments
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_education] => Array
                (
                    [label] => Field collection field_resume_education
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-education
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_job_preferences] => Array
                (
                    [label] => Field collection field_resume_job_preferences
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-job-preferences
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_languages] => Array
                (
                    [label] => Field collection field_resume_languages
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-languages
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_personal_info] => Array
                (
                    [label] => Field collection field_resume_personal_info
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-personal-info
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_skills_general] => Array
                (
                    [label] => Field collection field_resume_skills_general
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-skills-general
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_skills_it] => Array
                (
                    [label] => Field collection field_resume_skills_it
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-skills-it
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

            [field_resume_xp] => Array
                (
                    [label] => Field collection field_resume_xp
                    [admin] => Array
                        (
                            [path] => admin/structure/field-collections/%field_collection_field_name
                            [real path] => admin/structure/field-collections/field-resume-xp
                            [bundle argument] => 3
                            [access arguments] => Array
                                (
                                    [0] => administer field collections
                                )

                        )

                    [rdf_mapping] => Array
                        (
                        )

                )

        )

    [static cache] => 1
    [field cache] => 1
    [load hook] => field_collection_item_load
    [translation] => Array
        (
        )

    [schema_fields_sql] => Array
        (
            [base table] => Array
                (
                    [0] => item_id
                    [1] => field_name
                )

        )

    [configuration] => 
)
danielb’s picture

perfect, thank you!

danielb’s picture

I've committed changes, it should not show this error anymore. I'll leave this issue open for a little while in case there are side-effects or further related issues in the process.

danielb’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.