Notice: Undefined index: label in __construct() (line 75 of sites/all/modules/linkit/plugins/linkit_search/entity.class.php)

I think this is because entities don't have to set $entity_info[$entity_type]['entity keys']['label'], when 'label callback' is defined.

I see the label key is necessary for Linkit to perform its searches, though. Perhaps entities without a label key should not be listed as options in the Linkit profile settings. Or Linkit should try to guess the label key, trying perhaps 'title', 'name', and 'label'.

Comments

anou’s picture

I've got the same issue:

Notice : Undefined index: label dans LinkitSearchPluginEntity->__construct() (line 75 in .../sites/all/modules/linkit/plugins/linkit_search/entity.class.php).

Appears when I want to add a profile for example: admin/config/content/linkit/add

sahaj’s picture

Getting the same message. No idea what to do?

anon’s picture

So if ['entity keys']['label' isn't defined, can you use label_callback() instead?

If someone provides me a patch, I'll take a look at it.

EDIT: What type of entity do you have that do NOT have label defined?

azovsky’s picture

In my case there is an error "Undefined index: label ..." for FieldCollectionItemEntity.

azovsky’s picture

If you use the Field collection module, then perhaps it would be useful to address this issue: see #3 in #1263674: Add bundle keys to entity_info.

anon’s picture

Status: Active » Fixed

Commited a fix to 7.x-3.x

Status: Fixed » Closed (fixed)

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

screon’s picture

I am on 7.x-3.x and I still encounter the issue described by anou