[BUGFIX] Catch InvalidArgumentException for missing site languages in…#4534
Open
mikelwohlschlegel wants to merge 1 commit intoTYPO3-Solr:mainfrom
Open
[BUGFIX] Catch InvalidArgumentException for missing site languages in…#4534mikelwohlschlegel wants to merge 1 commit intoTYPO3-Solr:mainfrom
mikelwohlschlegel wants to merge 1 commit intoTYPO3-Solr:mainfrom
Conversation
59609f7 to
3461e78
Compare
… GarbageHandler When page records reference a sys_language_uid that is not configured in the site, Site::getLanguageById() throws an InvalidArgumentException. The existing catch only handles SiteNotFoundException. This adds InvalidArgumentException to the catch block so pages with unconfigured languages are treated as non-indexable instead of crashing. Fixes: TYPO3-Solr#4533
dkd-kaehm
pushed a commit
to dkd-kaehm/ext-solr
that referenced
this pull request
Feb 19, 2026
… GarbageHandler When page records reference a sys_language_uid that is not configured in the site, Site::getLanguageById() throws an InvalidArgumentException. The existing catch only handles SiteNotFoundException. This adds InvalidArgumentException to the catch block so pages with unconfigured languages are treated as non-indexable instead of crashing. Fixes: TYPO3-Solr#4533 Ports: TYPO3-Solr#4534
This file contains hidden or 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
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.
What this PR does
Adds
\InvalidArgumentExceptionto the catch block inGarbageHandler::isIndexablePageType().When a page record references a
sys_language_uidthat does not exist in the site configuration (e.g. a language was removed or disabled),Site::getLanguageById()throws anInvalidArgumentException. The existing catch only handlesSiteNotFoundException, causing the backend to crash when saving page properties.With this fix, pages referencing unconfigured languages are treated as non-indexable (same behavior as when a site is not found).
How to test
sys_language_uidstill exist in the database)InvalidArgumentException: Language X does not exist on site YFixes: #4533