Search throws a notice & warning message when searching for content:

Notice: Undefined property: stdClass::$zm_parent_entity in theme_apachesolr_search_snippets__file() (line 545 of /mnt/www/html/generalitest/docroot/sites/all/modules/contrib/apachesolr_attachments/apachesolr_attachments.module).
Warning: Invalid argument supplied for foreach() in theme_apachesolr_search_snippets__file() (line 545 of /mnt/www/html/generalitest/docroot/sites/all/modules/contrib/apachesolr_attachments/apachesolr_attachments.module).

As can be seen on this test website:
http://test.geb.com/search/site/healthcare

The message appears 3 times which corresponds with the number of results inside indexed files.

The website use the dev version of apachesolr_attachments + apache solr 7.x-1.0-beta16 + acquia search

Comments

nick_vh’s picture

Have you reindexed? Latest commit changed this field

batigolix’s picture

yes i deleted the search index (but from the apache solr config page) & uninstalled all search related modules

after re-enabling and re-indexing the problem still exists

batigolix’s picture

error still occurring after deleting index via the solr attachment config page admin/config/search/apachesolr/attachments

nick_vh’s picture

Can you verify if zm_parent_entity exists in your solr fields? (visible in http://apachesolrissues.dev/admin/reports/apachesolr)

Also, valuable info can be found when debugging the theme_apachesolr_search_snippets__file function. An export of the $doc variable would be useful. Also please upgrade to beta19 for apachesolr

nick_vh’s picture

Status: Active » Postponed (maintainer needs more info)
batigolix’s picture

Status: Postponed (maintainer needs more info) » Active

1. nope, zm_parent_entity doesnt exist / is not visible in /admin/reports/apachesolr

2. export of the $doc variable:

stdClass Object
(
    [id] => 83xeiy/file/535-node-542
    [entity_id] => 535
    [entity_type] => file
    [bundle] => file
    [bundle_name] => File
    [label] => brochure-and-factsheets.pdf
    [tos_name] => boris
    [is_uid] => 1
    [ds_created] => 2012-04-16T09:07:03Z
    [ds_changed] => 2012-04-16T09:07:03Z
    [is_comment_count] => 0
    [url] => http://test.geb.com/files/brochures/brochure-and-factsheets_1.pdf
    [path] => http://test.geb.com/files/brochures/brochure-and-factsheets_1.pdf
    [ss_filemime] => application/pdf
    [score] => 0.051228687
)

3. will try upgrading to beta19 now

batigolix’s picture

the upgrade to beta19 did not automagically solve the issue.

what do you recommend? re-installing all modules search related modules again?

nick_vh’s picture

After upgrading, did you re-index? I would recommend that you debug apachesolr_attachments_solr_document() and figure out what is being sent as zm_parent_entity

tauno’s picture

(removed my previous comment since I think it was unrelated)

Don't forget to update your solr schema.xml using the latest version from the main apachesolr module. I was using a version that didn't define the zm_* field type.

nick_vh’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

gmreed’s picture

Status: Closed (fixed) » Active

Hi, I hope it is okay to reopen this issue as I have encountered the same message for attachments:

Notice: Undefined property: stdClass::$zm_parent_entity in theme_apachesolr_search_snippets__file() (line 545 of /home/italaw/dev/sites/all/modules/apachesolr_attachments/apachesolr_attachments.module).
Warning: Invalid argument supplied for foreach() in theme_apachesolr_search_snippets__file() (line 545 of /home/italaw/dev/sites/all/modules/apachesolr_attachments/apachesolr_attachments.module)

My setup is:
Apache Solr search attachments 7.x-1.0+16-dev
Apache Solr search 7.x-1.0-beta19

It seems that my problem has to do with schema.xml as per #9 above: I have confirmed that the schema.xml on my web server is drupal-3.0-beta16 version 1.2, which does define the zm_* field type (per #9 above). However, I am totally confused because when I open up the schema.xml from .../admin/reports/apachesolr/conf it is only drupal-3.0-beta4 and does not define the zm_* field type. It also lists the modified date as June 2nd even though I removed and reinstalled the modules today. After reinstalling the modules I then went to update.php but it listed no pending updates. So have I missed a step? Do I need to do something further to update the schema.xml and get the zm_* fields defined for the search indexing?

Also, I deleted the search indexes before uninstalling and reinstalling the modules but before doing so I checked .../admin/reports/apachesolr per #4 above and confirmed that zm_parent_entity did not exist.

Any help would be totally appreciated.

gmreed’s picture

After a bit more research it looks like I omitted a critical part of my setup: the site is using Acquia Search. So it looks like the schema.xml file is controlled by them and I have therefore posted an issue at Acquia Connector: http://drupal.org/node/1630514

If I am still off base, any advice or input would be great. Otherwise apologizes for cluttering up the issue queue over here.

nick_vh’s picture

You can select the schema in the settings pane in the network, look at the docs and choose schema-16

nick_vh’s picture

Status: Active » Closed (fixed)
laken’s picture

N.B. On Acquia Search the schemas have been updated - schema-16 is no longer available. Currently you must select one of the 'apachesolr 7.x-1.0-rc2' schemas like so: https://skitch.com/alaken/epr2r/andy.laken-acquia

Hope that helps anyone with the same issue,