diff --git a/apachesolr_attachments.module b/apachesolr_attachments.module
index 45ff2d9..565be0d 100644
--- a/apachesolr_attachments.module
+++ b/apachesolr_attachments.module
@@ -200,10 +200,10 @@ function apachesolr_attachments_solr_document(ApacheSolrDocument $document, $fil
 * @param string $entity_type
 *   The type of entity we're dealing with.
 */
-function apachesolr_attachments_node_solr_document(ApacheSolrDocument &$document, $parent_entity, $env_id) {
+function apachesolr_attachments_node_solr_document(ApacheSolrDocument &$document, $parent_entity, $entity_type) {
   module_load_include('inc', 'apachesolr_attachments', 'apachesolr_attachments.index');
 
-  list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids('node', $parent_entity);
+  list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids($entity_type, $parent_entity);
 
   // proceed with combining attachment content to entity document only if the
   // parent entity is flagged for indexing attachments with parent entity
@@ -553,7 +553,7 @@ function _apachesolr_attachments_update_parent_entity($entity, $type) {
         }
 
         // get the bundle
-        list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids('node', $parent_entity);
+        list($parent_entity_id, $parent_entity_vid, $parent_entity_bundle) = entity_extract_ids($parent_entity_type, $parent_entity);
 
         if (variable_get('apachesolr_attachments_entity_bundle_indexing_' . $parent_entity_bundle, 'seperate') == 'parent') {
           apachesolr_entity_update($parent_entity, $parent_entity_type);
@@ -776,4 +776,4 @@ class ApachesolrAttachmentsEntityFieldQuery extends EntityFieldQuery {
     );
     return $this;
   }
-}
\ No newline at end of file
+}
