TYPO3-Solr / ext-solr

A TYPO3 extension that integrates the Apache Solr search server with TYPO3 CMS. dkd Internet Service GmbH is developing the extension. Community contributions are welcome. See CONTRIBUTING.md for details.
GNU General Public License v3.0
137 stars 252 forks source link

[BUG] Insert records cannot be indexed if they contain Extbase plugins #2296

Open dmitryd opened 5 years ago

dmitryd commented 5 years ago

Describe the bug

Imagine that you have something like this in your indexing queue:

fields {
        content = SOLR_CONTENT
        content {
            cObject = CONTENT
            cObject {
                select {
                    orderBy = sorting
                    pidInList.field = pid
                    selectFields = *
                    where.dataWrap = tx_blog_tag_content={field:uid} AND sys_language_uid={field:sys_language_uid} AND CType<>'list'
                }
                table = tt_content
                renderObj = < tt_content
            }
        }
}

This should create content from irre records in the indexed record.

Now if irre records contain an Extbase plugin, indexing will always fail with an exception: "Default controller for the plugin cannot be determined. Please check configurePlugin in ext_localconf.php". Fetching the page via FE context works.

The problem is that Extbase tries to find the configuration for the Extbase controller and cannot because this indexing will run in the Backend context and Extbase will use BackendConfigurationManager, which expects module.tx_, not plugin.tx_. So it will not be able to index any plugin this way.

I do not think this is solvable in any way on the solr level. Rather this special case (with the error message) should go to the documentation. It cost me 1.5h of time to find the reason why the error happened. It would be good if others could find at least a description why it cannot be done.

dmitryd commented 5 years ago

I solved it for our project by making a silent content object exception handler, which activates when solr is indexing. It will simply ignore all exceptions from content elements while indexing. Thus data will be incomplete in index but it is ok for our case because those plugins are filter forms (not useful for search results).