PHP 5.3.3
CentOS 5.7
Apache 2.2.3
Apache Solr 7.x-1.1
Apache Solr Attachments 7.x-1.2 and 7.x-1.x-dev
After installing and configuring Apache Solr Attachments and a few runs of the index, on every AJAX request a 500 server error occurs.
PHP Fatal error: Unsupported operand types in sites/all/modules/apachesolr/apachesolr.index.inc on line 414
The corresponding function in apachesolr.index.inc is:
function _apachesolr_index_process_entity_get_document($entity, $entity_type) {
list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);
$document = new ApacheSolrDocument();
// Define our url options in advance. This differs depending on the
// language
$languages = language_list();
$url_options = array('absolute' => TRUE);
if (isset($entity->language) && isset($languages[$entity->language])) {
$url_options = $url_options + array('language' => $languages[$entity->language]);
}
$document->id = apachesolr_document_id($entity_id, $entity_type);
$document->site = url(NULL, $url_options);
$document->hash = apachesolr_site_hash();
$document->entity_id = $entity_id;
$document->entity_type = $entity_type;
$document->bundle = $bundle;
$document->bundle_name = entity_bundle_label($entity_type, $bundle);
if (empty($entity->language)) {
// 'und' is the language-neutral code in Drupal 7.
$document->language = LANGUAGE_NONE;
}
else {
$document->language = $entity->language;
}
$path = entity_uri($entity_type, $entity);
// A path is not a requirement of an entity
if (!empty($path)) {
$document->path = $path['path'];
$document->url = url($path['path'], $path['options'] + $url_options);
// Path aliases can have important information about the content.
// Add them to the index as well.
if (function_exists('drupal_get_path_alias')) {
// Add any path alias to the index, looking first for language specific
// aliases but using language neutral aliases otherwise.
$output = drupal_get_path_alias($document->path, $document->language);
if ($output && $output != $document->path) {
$document->path_alias = $output;
}
}
}
return $document;
}
Line 414 is:
$document->url = url($path['path'], $path['options'] + $url_options);
I'd put this in the apachesolr queue but it only happens when apachesolr_attachments is enabled. I suspect it has something to do with $path['options'] + $url_options but I have not figured out a good way to see what the value of those are as this is in an ajax request and it throws a fatal error when you try to process it.
Steps to reproduce:
Install apachesolr_attachments, add file field to article content type. Save a couple nodes with attachments. Wait for index. Edit the node and try to tag a taxonomy term using autocompleter.
Ideas?
Comments
Comment #1
haydeniv commentedThis error occurred while running Drupal 7.8, just upgraded to 7.17 and problem no longer occurs.