Skip to content
Snippets Groups Projects

Issue #3231996: Ensure file system is writeable

1 unresolved thread
1 file
+ 5
7
Compare changes
  • Side-by-side
  • Inline
@@ -76,10 +76,10 @@ class WritableFileSystemValidator implements EventSubscriberInterface {
* temporarily.
* @param \Drupal\automatic_updates\Event\UpdateEvent $event
* The event object.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup $error_message
* The error message to flag if the path is not writable.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup $summary
* The error summary if the path is not writable.
*/
protected function checkPath(string $path_to_check, string $file_to_copy, UpdateEvent $event, TranslatableMarkup $error_message): void {
protected function checkPath(string $path_to_check, string $file_to_copy, UpdateEvent $event, TranslatableMarkup $summary): void {
$source = $path_to_check . DIRECTORY_SEPARATOR . $file_to_copy;
$destination = uniqid($source);
@@ -90,10 +90,8 @@ class WritableFileSystemValidator implements EventSubscriberInterface {
$this->fileSystem->delete($destination);
}
catch (FileException $e) {
$result = ValidationResult::createError([
$error_message,
$e->getMessage(),
]);
$message = $e->getMessage();
$result = ValidationResult::createError([$message], $summary);
$event->addValidationResult($result);
}
}
Loading