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
136 stars 246 forks source link

[BUG] The first translated record from a storage folder outside the rootpage doesn't get indexed #3400

Open waltermulder opened 1 year ago

waltermulder commented 1 year ago

When I run the index process, all items are indexed (default language and translated) except from the first item the translated record is skipped. I have two solar cores (website_nl and website_de). When I debug the solr connections the rootPageId of the first translated item is 32. For all the other items it is 1000. Debugging ApacheSolrForTypo3\Solr\Domain\Index\Queue\RecordMonitor\Helper\RootPageResolver has the method getRootPageId. The $GLOBALS['TSFE']->rootLine is empty for the first record. The fallback kicks in and resolves to id 32 for the translated record.

To Reproduce create a folder outside the site structure and create some records with translations. Empty Index Queue and run index.

Used versions:

In extension configuratio basic.useConfigurationTrackRecordsOutsideSiteroot is checked.

Site Configuration (config.yaml):

languages:
  -
    title: Nederlands
    enabled: true
    base: /nl/
    typo3Language: nl
    locale: nl_NL.UTF-8
    iso-639-1: nl
    navigationTitle: Nederlands
    hreflang: nl-NL
    direction: ltr
    flag: nl
    solr_core_read: '%env(SOLR_CORE_WEBSITE_NL)%'
    languageId: 0
    websiteTitle: ''
    recordSturage: 33
  -
    languageId: 1
    title: Deutsch
    navigationTitle: Deutsch
    base: /de/
    locale: de_DE.UTF-8
    iso-639-1: de
    hreflang: de-DE
    direction: ltr
    typo3Language: de
    flag: de
    solr_core_read: '%env(SOLR_CORE_WEBSITE_DE)%'
    fallbackType: fallback
    fallbacks: '1,0'
    enabled: true
    websiteTitle: ''
    recordSturage: 33
rootPageId: 1000
solr_enabled_read: true
solr_host_read: localhost
solr_host_write: localhost
solr_path_read: /solr/
solr_path_write: /
solr_port_read: '%env(SOLR_PORT)%'
solr_scheme_write: ''
solr_use_write_connection: false
dkd-kaehm commented 1 year ago

@waltermulder Thanks for reporting that issue.

Please provide more information:

Also like on our issue template

It seems you are not using plugin.tx_solr.index.queue.[indexConfig].additionalPageIds setting.

waltermulder commented 1 year ago

Additional information: The typoscript config for the records is:

plugin.tx_solr {
    ...
    index {
        ...
        queue {
            products = 1
products {
                 table = tx_nkproducts_domain_model_product
                 additionalPageIds = 33
                 additionalWhereClause = {$plugin.tx_solr.index.queue.products.additionalWhereClause}
            }
        }
    }
}

Part of the file structure:

page-sructure page-structure-2

I expect the first record to be indexed after running the index quee in both languages. Now the first record (which is the last updated record) is not indexed in the de language. The remaining records are indexed correctly.