Skip to content

Comments

[BUGFIX] Catch InvalidArgumentException for missing site languages in…#4534

Open
mikelwohlschlegel wants to merge 1 commit intoTYPO3-Solr:mainfrom
mikelwohlschlegel:main
Open

[BUGFIX] Catch InvalidArgumentException for missing site languages in…#4534
mikelwohlschlegel wants to merge 1 commit intoTYPO3-Solr:mainfrom
mikelwohlschlegel:main

Conversation

@mikelwohlschlegel
Copy link

What this PR does

Adds \InvalidArgumentException to the catch block in GarbageHandler::isIndexablePageType().

When a page record references a sys_language_uid that does not exist in the site configuration (e.g. a language was removed or disabled), Site::getLanguageById() throws an InvalidArgumentException. The existing catch only handles SiteNotFoundException, 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

  1. Set up a TYPO3 site with multiple languages configured
  2. Create page translations in one of those languages
  3. Remove that language from the site configuration (so page records with that sys_language_uid still exist in the database)
  4. Open page properties of any page and click "Save"
  5. Before fix: InvalidArgumentException: Language X does not exist on site Y
  6. After fix: Page saves successfully, a warning is logged

Fixes: #4533

… 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
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

Successfully merging this pull request may close these issues.

[BUG] GarbageHandler crashes with InvalidArgumentException when page references a language not configured in site

1 participant