Notice: Undefined index: search_index in field_extra_fields_get_display() (line 693 of var/www/virtual/drupal/modules/field/field.module). It's attributed to an anonymous user.

This notice shows up in the logs six consecutive times, or more in multiples of six. It appears to be triggered each time new content is indexed by Apache Solr.

I've eliminated the error by adding an if/else around line 693 as follows (the second line of code is line 693):

		if (isset($extra_fields[$name]['display'][$actual_mode])) {
		  $displays[$name] = $extra_fields[$name]['display'][$actual_mode];
		} else {
 		  $displays[$name] = '';
		}

Drupal 7.27
PHP 5.4.12
MySQL 5.5.30

Comments

stoickthevast’s picture

stoickthevast’s picture

Status: Active » Needs review
dcam’s picture

Status: Needs review » Postponed (maintainer needs more info)

The actual cause of this issue should have been tracked down. It sounds like a module is implementing extra fields inappropriately. In that case all this change would do is prevent an error message, not fix a problem.

At a minimum the original bug report should have included a list of enabled modules so their code could be inspected for calls to field_extra_fields_get_display(). Since it kind of sounds like this has something to do with the Apache Solr module, I checked its code, but it doesn't have any call to the function. Steps to reproduce the problem would be nice too.

Version: 7.27 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Postponed (maintainer needs more info) » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.