Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] solr_path_write is not used #2916

Closed
EmanuelOster opened this issue Apr 15, 2021 · 2 comments
Closed

[BUG] solr_path_write is not used #2916

EmanuelOster opened this issue Apr 15, 2021 · 2 comments

Comments

@EmanuelOster
Copy link

Describe the bug
The plugin allows the configuration of a separate write connection for solr and even offers part of it through the UI.
However, the solr_path_write configuration is completely ignored and instead the solr_path_read configuration is used instead.
The same happens if I try to configure the solr_core_write option for a given language. solr_core_read is used instead.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Sites', open a site configuration and switch to the Solr-Tab
  2. Configure a different path for the write configuration and save
  3. Go to Apache Solr->Info
  4. Following Apache Solr servers have been contacted: is displayed with the write configuration for host and Port, but read configuration for path and core.

Expected behavior
Only the write configuration is used for write connections.

Screenshots
image
image

Used versions (please complete the following information):

  • TYPO3 Version: 10.4.12
  • EXT:solr Version: 11.0.3
  • Used Apache Solr Version: 8.8.1

Additional context
I took a look at the source code and found the relevant code in the SiteRepository:

'write' => [
                        'scheme' => SiteUtility::getConnectionProperty($typo3Site, 'scheme', $languageUid, 'write', 'http'),
                        'host' => SiteUtility::getConnectionProperty($typo3Site, 'host', $languageUid, 'write', 'localhost'),
                        'port' => (int)SiteUtility::getConnectionProperty($typo3Site, 'port', $languageUid, 'write', 8983),
                        // @todo: transform core to path
                        'path' =>
                            SiteUtility::getConnectionProperty($typo3Site, 'path', $languageUid, 'read', '/solr/') .
                            SiteUtility::getConnectionProperty($typo3Site, 'core', $languageUid, 'read', 'core_en') . '/' ,
                        'username' => SiteUtility::getConnectionProperty($typo3Site, 'username', $languageUid, 'write', ''),
                        'password' => SiteUtility::getConnectionProperty($typo3Site, 'password', $languageUid, 'write', ''),
                        'timeout' => SiteUtility::getConnectionProperty($typo3Site, 'timeout', $languageUid, 'write', 0)
                    ],

As you can see, the path uses the read scope for both the path and core options, instead of the write scope. If I change the scope, everything seems to work as desired, however I am not sure if there might be some undesired side effects in doing so.

@dkd-kaehm
Copy link
Collaborator

dkd-kaehm commented Apr 19, 2021

@EmanuelOster thanks for reporting,
Is nice catch.
Hopefully is that a simple typo and not intended to be so.
We'll check and fix that, but pull requests are welcome.

Affected EXT:Solr versions: 10, 11, 11.5, main.

dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Feb 14, 2022
Path of write connection is read from read scope, so diffrent paths
couldn't be used, this is fixed by inserting the right scope.

Fixes: TYPO3-Solr#2916
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Feb 14, 2022
Path of write connection is read from read scope, so different paths
couldn't be used, this is fixed by inserting the right scope.

Fixes: TYPO3-Solr#2916
dkd-friedrich added a commit that referenced this issue Feb 14, 2022
Path of write connection is read from read scope, so different paths
couldn't be used, this is fixed by inserting the right scope.

Fixes: #2916
@dkd-friedrich
Copy link
Member

Fixed with #3200

dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Feb 15, 2022
Path of write connection is read from read scope, so different paths
couldn't be used, this is fixed by inserting the right scope.

Fixes: TYPO3-Solr#2916
dkd-kaehm pushed a commit that referenced this issue Feb 15, 2022
Path of write connection is read from read scope, so different paths
couldn't be used, this is fixed by inserting the right scope.

Fixes: #2916
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Nov 2, 2022
This is a maintaine release for TYPO3 10.4, containing:

- [BUGFIX] Prepend wrong fe language on empty cache (TYPO3-Solr#3375)
- [TASK] Use TYPO3 IpAnonymizationUtility (TYPO3-Solr#3262)
- [BUGFIX:BP:11.2] Shortcircuit work in SolrRoutingMiddleware (TYPO3-Solr#3202)
- [TASK] Fix scrutinizer on release-11.2.x
- [BUGFIX:BP:11.2] Do not handle page updates on new page with uid 0
(TYPO3-Solr#3338)
- [TASK] Remove not used strptime() adaption for windows.
- [BUGFIX] Respect indexing configuration for new and updated subpages
(TYPO3-Solr#3276)
- [BUGFIX] Ensure keywords string does not exceed database field length
(TYPO3-Solr#3321)
- [TASK:BP:11.2] Adapt column arrangement within sites config (TYPO3-Solr#3295)
- [DOCS:BP:11.2] add missing doc for ..pageIndexed (#)
- [BUGFIX] Fix PSR-4 Namespaces and Paths (TYPO3-Solr#3285)
- [BUGFIX] Silence DebugWriter for PageIndexerRequest (TYPO3-Solr#3030)
- [BUGFIX] AbstractSolrTask::setRootPageId(): Argument TYPO3-Solr#1 () must be
of type int, string given (TYPO3-Solr#3267)
- [BUGFIX:11.2] Update GarbageCollector.php (TYPO3-Solr#3249)
- [DOCS] Align with new TYPO3 documentation standards (TYPO3-Solr#3242)
- [DOCS] Align README.md with other extensions (TYPO3-Solr#3218)
- [BUGFIX] Missing dot in configuration in numberOfResultsPerGroup
method (TYPO3-Solr#3098
- [TASK] Added info about using page content in fields
- [TASK] Added info about the virtual field __solr_contents
- [BUGFIX:BP:11.2] Fix write connection (TYPO3-Solr#2916)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.1.3

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

Submit bug reports and feature requests on GitHub
Ask or help or answer questions in our Slack channel
Provide patches through Pull Request or review and comment on existing
Pull Requests
Go to www.typo3-solr.com or call dkd to sponsor the ongoing development
of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Nov 2, 2022
This is a maintenance release for TYPO3 10.4, containing:

- [BUGFIX] Prepend wrong fe language on empty cache (TYPO3-Solr#3375)
- [TASK] Use TYPO3 IpAnonymizationUtility (TYPO3-Solr#3262)
- [BUGFIX:BP:11.2] Shortcircuit work in SolrRoutingMiddleware (TYPO3-Solr#3202)
- [TASK] Fix scrutinizer on release-11.2.x
- [BUGFIX:BP:11.2] Do not handle page updates on new page with uid 0
(TYPO3-Solr#3338)
- [TASK] Remove not used strptime() adaption for windows.
- [BUGFIX] Respect indexing configuration for new and updated subpages
(TYPO3-Solr#3276)
- [BUGFIX] Ensure keywords string does not exceed database field length
(TYPO3-Solr#3321)
- [TASK:BP:11.2] Adapt column arrangement within sites config (TYPO3-Solr#3295)
- [DOCS:BP:11.2] add missing doc for ..pageIndexed (#)
- [BUGFIX] Fix PSR-4 Namespaces and Paths (TYPO3-Solr#3285)
- [BUGFIX] Silence DebugWriter for PageIndexerRequest (TYPO3-Solr#3030)
- [BUGFIX] AbstractSolrTask::setRootPageId(): Argument TYPO3-Solr#1 () must be
of type int, string given (TYPO3-Solr#3267)
- [BUGFIX:11.2] Update GarbageCollector.php (TYPO3-Solr#3249)
- [DOCS] Align with new TYPO3 documentation standards (TYPO3-Solr#3242)
- [DOCS] Align README.md with other extensions (TYPO3-Solr#3218)
- [BUGFIX] Missing dot in configuration in numberOfResultsPerGroup
method (TYPO3-Solr#3098
- [TASK] Added info about using page content in fields
- [TASK] Added info about the virtual field __solr_contents
- [BUGFIX:BP:11.2] Fix write connection (TYPO3-Solr#2916)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.2.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

Submit bug reports and feature requests on GitHub
Ask or help or answer questions in our Slack channel
Provide patches through Pull Request or review and comment on existing
Pull Requests
Go to www.typo3-solr.com or call dkd to sponsor the ongoing development
of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
dkd-friedrich added a commit to dkd-friedrich/ext-solr that referenced this issue Nov 2, 2022
This is a maintenance release for TYPO3 10.4, containing:

- [BUGFIX] Prepend wrong fe language on empty cache (TYPO3-Solr#3375)
- [TASK] Use TYPO3 IpAnonymizationUtility (TYPO3-Solr#3262)
- [BUGFIX:BP:11.2] Shortcircuit work in SolrRoutingMiddleware (TYPO3-Solr#3202)
- [TASK] Fix scrutinizer on release-11.2.x
- [BUGFIX:BP:11.2] Do not handle page updates on new page with uid 0
(TYPO3-Solr#3338)
- [TASK] Remove not used strptime() adaption for windows.
- [BUGFIX] Respect indexing configuration for new and updated subpages
(TYPO3-Solr#3276)
- [BUGFIX] Ensure keywords string does not exceed database field length
(TYPO3-Solr#3321)
- [TASK:BP:11.2] Adapt column arrangement within sites config (TYPO3-Solr#3295)
- [DOCS:BP:11.2] add missing doc for ..pageIndexed
- [BUGFIX] Fix PSR-4 Namespaces and Paths (TYPO3-Solr#3285)
- [BUGFIX] Silence DebugWriter for PageIndexerRequest (TYPO3-Solr#3030)
- [BUGFIX] AbstractSolrTask::setRootPageId(): Argument TYPO3-Solr#1 must be
of type int, string given (TYPO3-Solr#3267)
- [BUGFIX:11.2] Update GarbageCollector.php (TYPO3-Solr#3249)
- [DOCS] Align with new TYPO3 documentation standards (TYPO3-Solr#3242)
- [DOCS] Align README.md with other extensions (TYPO3-Solr#3218)
- [BUGFIX] Missing dot in configuration in numberOfResultsPerGroup
method (TYPO3-Solr#3098
- [TASK] Added info about using page content in fields
- [TASK] Added info about the virtual field __solr_contents
- [BUGFIX:BP:11.2] Fix write connection (TYPO3-Solr#2916)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.2.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

Submit bug reports and feature requests on GitHub
Ask or help or answer questions in our Slack channel
Provide patches through Pull Request or review and comment on existing
Pull Requests
Go to www.typo3-solr.com or call dkd to sponsor the ongoing development
of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
dkd-friedrich added a commit that referenced this issue Nov 2, 2022
This is a maintenance release for TYPO3 10.4, containing:

- [BUGFIX] Prepend wrong fe language on empty cache (#3375)
- [TASK] Use TYPO3 IpAnonymizationUtility (#3262)
- [BUGFIX:BP:11.2] Shortcircuit work in SolrRoutingMiddleware (#3202)
- [TASK] Fix scrutinizer on release-11.2.x
- [BUGFIX:BP:11.2] Do not handle page updates on new page with uid 0
(#3338)
- [TASK] Remove not used strptime() adaption for windows.
- [BUGFIX] Respect indexing configuration for new and updated subpages
(#3276)
- [BUGFIX] Ensure keywords string does not exceed database field length
(#3321)
- [TASK:BP:11.2] Adapt column arrangement within sites config (#3295)
- [DOCS:BP:11.2] add missing doc for ..pageIndexed
- [BUGFIX] Fix PSR-4 Namespaces and Paths (#3285)
- [BUGFIX] Silence DebugWriter for PageIndexerRequest (#3030)
- [BUGFIX] AbstractSolrTask::setRootPageId(): Argument #1 must be
of type int, string given (#3267)
- [BUGFIX:11.2] Update GarbageCollector.php (#3249)
- [DOCS] Align with new TYPO3 documentation standards (#3242)
- [DOCS] Align README.md with other extensions (#3218)
- [BUGFIX] Missing dot in configuration in numberOfResultsPerGroup
method (#3098
- [TASK] Added info about using page content in fields
- [TASK] Added info about the virtual field __solr_contents
- [BUGFIX:BP:11.2] Fix write connection (#2916)

Please read the release notes:
https://github.com/TYPO3-Solr/ext-solr/releases/tag/11.2.1

---

How to Get Involved

There are many ways to get involved with Apache Solr for TYPO3:

Submit bug reports and feature requests on GitHub
Ask or help or answer questions in our Slack channel
Provide patches through Pull Request or review and comment on existing
Pull Requests
Go to www.typo3-solr.com or call dkd to sponsor the ongoing development
of Apache Solr for TYPO3

Support us by becoming an EB partner:
https://shop.dkd.de/Produkte/Apache-Solr-fuer-TYPO3/

or call:
+49 (0)69 - 2475218 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants