-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
[BUGFIX] handle localizations with un-available tsfe more gracefully #3737
Merged
dkd-kaehm
merged 1 commit into
TYPO3-Solr:main
from
adamkoppede:bugfix/handle_localizations_with_un-available_tsfe_more_gracefully
Oct 13, 2023
Merged
[BUGFIX] handle localizations with un-available tsfe more gracefully #3737
dkd-kaehm
merged 1 commit into
TYPO3-Solr:main
from
adamkoppede:bugfix/handle_localizations_with_un-available_tsfe_more_gracefully
Oct 13, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dkd-kaehm
approved these changes
Oct 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tanks for this fix.
68 tasks
Given the following scenario: - non-localized root page for multi-language site - below this root page is a localized folder - inside that localized folder are localized record to index Since TypoScriptFrontendController is not initialized for sys_folder page records, it'll walk up to the parent page and try to initialize TypoScriptFrontendController for it. However, this isn't possible in the given scenario because the page isn't localized into all languages. Tsfe::getTsfeByPageIdAndLanguageId() returns null in this case, which triggers a NullPointerException when getLanguageOverlay() is called on it. When the NPE is thrown none of the localizations of the item will be indexed, even though some could have been successfully indexed. This change checks aborts the operation when the specific TypoScriptFrontendController for the item is null, which causes queue items for which TypoScriptFrontendController could not be initialized to not get indexed.
dkd-kaehm
force-pushed
the
bugfix/handle_localizations_with_un-available_tsfe_more_gracefully
branch
from
October 13, 2023 15:11
b86a0d0
to
cce919e
Compare
dkd-kaehm
pushed a commit
to dkd-kaehm/ext-solr
that referenced
this pull request
Oct 13, 2023
Given the following scenario: - non-localized root page for multi-language site - below this root page is a localized folder - inside that localized folder are localized record to index Since TypoScriptFrontendController is not initialized for sys_folder page records, it'll walk up to the parent page and try to initialize TypoScriptFrontendController for it. However, this isn't possible in the given scenario because the page isn't localized into all languages. Tsfe::getTsfeByPageIdAndLanguageId() returns null in this case, which triggers a NullPointerException when getLanguageOverlay() is called on it. When the NPE is thrown none of the localizations of the item will be indexed, even though some could have been successfully indexed. This change checks aborts the operation when the specific TypoScriptFrontendController for the item is null, which causes queue items for which TypoScriptFrontendController could not be initialized to not get indexed. Ports: TYPO3-Solr#3737
dkd-kaehm
pushed a commit
that referenced
this pull request
Oct 13, 2023
Given the following scenario: - non-localized root page for multi-language site - below this root page is a localized folder - inside that localized folder are localized record to index Since TypoScriptFrontendController is not initialized for sys_folder page records, it'll walk up to the parent page and try to initialize TypoScriptFrontendController for it. However, this isn't possible in the given scenario because the page isn't localized into all languages. Tsfe::getTsfeByPageIdAndLanguageId() returns null in this case, which triggers a NullPointerException when getLanguageOverlay() is called on it. When the NPE is thrown none of the localizations of the item will be indexed, even though some could have been successfully indexed. This change checks aborts the operation when the specific TypoScriptFrontendController for the item is null, which causes queue items for which TypoScriptFrontendController could not be initialized to not get indexed. Ports: #3737
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given the following scenario:
Since TypoScriptFrontendController is not initialized for sys_folder page records, it'll walk up to the parent page and try to initialize TypoScriptFrontendController for it. However, this isn't possible in the given scenario because the page isn't localized into all languages. Tsfe::getTsfeByPageIdAndLanguageId() returns null in this case, which triggers a NullPointerException when getLanguageOverlay() is called on it. When the NPE is thrown none of the localizations of the item will be indexed, even though some could have been successfully indexed.
This change checks aborts the operation when the specific TypoScriptFrontendController for the item is null, which causes queue items for which TypoScriptFrontendController could not be initialized to not get indexed.
How to test
I tested the change in TYPO3 11.5.30 and ext-solr 11.5.3