Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
apachesolr_node_type_insert() with a new node type was leading to a duplicate key error. This is due to the drupal_array_merge_deep() call in apachesolr_load_all_environments().
}
print_r($environments);
// Allow overrides of environments from settings.php
$conf_environments = variable_get('apachesolr_environments', array());
if (!empty($conf_environments)) {
$environments = drupal_array_merge_deep($environments, $conf_environments);
}
print_r($environments);
If you have:
$conf['apachesolr_environments']['solr']['index_bundles'] = array(
'node' => array('some_node_type')
);
and the node type is already configured, the drupal_array_merge_deep() call makes it appear twice in the array. Then from there, it's added twice to the db_insert() that writes to apachesolr_index_bundles().
Comment | File | Size | Author |
---|---|---|---|
#3 | 2023151-2.patch | 544 bytes | pwolanin |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedSo, seems like a fix would be to change to:
or otherwise make the bundle name the array key (rather than numeric keys)?
Comment #2
catchYes that'd work fine.
Comment #3
pwolanin CreditAttribution: pwolanin commentedThis might be at least the start of the fix - not sure if it will break existing ctools exports.
Comment #4
Nick_vhWe need some people with active exports to review this patch before we commit this. Catch can you confirm and mark it as RTBC perhaps?
Comment #4.0
Nick_vhUpdated issue summary.
Comment #5
eyeless CreditAttribution: eyeless commentedTested paired with Acquia Search, so the environment is re-saved on each cron run. Not seeing a duplicate entry error any more.
Comment #7
japerry