Hi,

I have the following notice when a try to clear the attachment text extraction cache :

Undefined property: stdClass::$field_file_fid in apachesolr_attachments_solr_reindex() (line 191 (...) which refers to this line :

$file->fid = $parent_entity_info->extraFields->field_file_fid;

A dsm() indicates there was no property like "field_file_fid" but something like "field_article_pdf_fid" in extraFields. It seems that I can't index files. Maybe the explanation is near this notice, don't you think ?

Regards,

K.L

Comments

nick_vh’s picture

Status: Active » Needs review
StatusFileSize
new846 bytes

Seems this is due to the fact that I didn't count on other field names/media :-)

Can you try this patch and see if it works for you?

kevinlabory’s picture

Thank you for your fast answer. The first notice is gone but I get an other one:

Notice : Undefined property: stdClass::$type in apachesolr_attachments_add_file_usage() (line 206 (...)
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null

kevinlabory’s picture

I found what was wrong with Undefined property: stdClass::$type in apachesolr_attachments_add_file_usage(). I think you changed in apachesolr_attachments.index.inc line 206 from version 1.0 to 1.1:

'bundle' => 'file', with 'bundle' => $file->type,

This is the problem because property 'type' is not in the file object. Now I get a notice in Apache_Solr_Document.php when I run cron:

Undefined index: path in ApacheSolrDocument->__get() (line 304 (...)

But file indexation works fine. I will stick with the older version of your module.

nick_vh’s picture

Status: Needs review » Needs work

Interesting,

making this work for non-media + media proves quite challenging :-)
I'll work on this small issue asap so we have a global solution for both pathways

nick_vh’s picture

Status: Needs work » Needs review
StatusFileSize
new1.59 KB
nick_vh’s picture

Status: Needs review » Fixed

committed, thanks for reporting

Status: Fixed » Closed (fixed)

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