#110550SiteSettingsService::writeSettings() silently swallows SiteConfigurationWriteException
Description
Bug Description
SiteSettingsService::writeSettings() silently catches SiteConfigurationWriteException internally and never re-throws it. As a result, callers have no way to detect whether a write succeeded or failed.
Root Cause
In EXT:core Classes/Site/SiteSettingsService.php, writeSettings() calls SiteWriter::writeConfiguration() inside a try/catch block that catches SiteConfigurationWriteException, enqueues a flash message, and returns — silently discarding the exception.
try {
$siteWriter->writeConfiguration($mergedSettings, $site->getIdentifier());
} catch (SiteConfigurationWriteException $e) {
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$e->getMessage(),
'',
ContextualFeedbackSeverity::ERROR,
true
);
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$flashMessageService->getMessageQueueByIdentifier()->enqueue($flashMessage);
// exception is swallowed — no rethrow
}
Flash messages are invisible in CLI and API contexts. Callers are forced to verify writes by re-reading the settings file, which is fragile.
Affected Versions
Verified in:- TYPO3 13.4 (LTS)
- TYPO3 14.3
- TYPO3 main (future 15.x)
Expected Behavior
SiteSettingsService::writeSettings() should re-throw SiteConfigurationWriteException after enqueuing the flash message, so callers can handle write failures.
Proposed Fix
Add throw $e; after enqueuing the flash message:
} catch (SiteConfigurationWriteException $e) {
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$e->getMessage(),
'',
ContextualFeedbackSeverity::ERROR,
true
);
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
$flashMessageService->getMessageQueueByIdentifier()->enqueue($flashMessage);
throw $e; // re-throw so callers can handle the failure
}
Note: In TYPO3 main (v15), FlashMessage is final, so new FlashMessage(...) replaces GeneralUtility::makeInstance().
I will create a patch for this.
Reviews 3
History 214
-
Gerrit Code Review pushed patch set 1 for main to change 95467 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-28T05:46:17+00:00" > 08/28/26, 05:46 </span> -
Simon Schmidt changed TYPO3 Version
1315 <span data-processor="relativetime" data-value="2026-08-28T05:51:51+00:00" > 08/28/26, 05:51 </span> -
Simon Schmidt commented and changed TYPO3 Version
1513 <span data-processor="relativetime" data-value="2026-08-28T05:53:53+00:00" > 08/28/26, 05:53 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-04T13:29:35+00:00" > 09/04/26, 13:29 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-04T13:29:40+00:00" > 09/04/26, 13:29 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-04T13:35:02+00:00" > 09/04/26, 13:35 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95647 <span data-processor="relativetime" data-value="2026-09-04T13:35:03+00:00" > 09/04/26, 13:35 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-04T14:04:06+00:00" > 09/04/26, 14:04 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-04T14:07:05+00:00" > 09/04/26, 14:07 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-07T09:21:31+00:00" > 09/07/26, 09:21 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-15T08:48:42+00:00" > 09/15/26, 08:48 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-15T08:54:52+00:00" > 09/15/26, 08:54 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 95467 <span data-processor="relativetime" data-value="2026-09-15T08:56:38+00:00" > 09/15/26, 08:56 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 95851 <span data-processor="relativetime" data-value="2026-09-15T10:07:33+00:00" > 09/15/26, 10:07 </span>
Bug Description
SiteSettingsService::writeSettings()silently catchesSiteConfigurationWriteExceptioninternally and never re-throws it. As a result, callers have no way to detect whether a write succeeded or failed.Root Cause
In
EXT:core Classes/Site/SiteSettingsService.php,writeSettings()callsSiteWriter::writeConfiguration()inside a try/catch block that catchesSiteConfigurationWriteException, enqueues a flash message, and returns — silently discarding the exception.Flash messages are invisible in CLI and API contexts. Callers are forced to verify writes by re-reading the settings file, which is fragile.
Affected Versions
Verified in:Expected Behavior
SiteSettingsService::writeSettings()should propagateSiteConfigurationWriteExceptionso callers can handle write failures appropriately.Proposed Fix
Two changes:
SiteSettingsService::writeSettings()entirely — letSiteConfigurationWriteExceptionpropagate naturally fromSiteWriter. Remove the now-unusedFlashMessageServicedependency from the service.SiteSettingsController::saveAction(), wrap thewriteSettings()call in a try/catch: on failure, add a flash message and redirect back to the edit page.This cleanly separates concerns: the service is purely functional, the controller is responsible for UI feedback.
I will create a patch for this.