reverted: --- b/google_analytics.module +++ a/google_analytics.module @@ -21,7 +21,6 @@ use Drupal\Core\Url; use Drupal\node\NodeInterface; use GuzzleHttp\Exception\RequestException; -use Drupal\Core\File\FileSystem; /** * Define the default file extension list that should be tracked as download. @@ -529,7 +528,7 @@ $path = 'public://google_analytics'; if (file_prepare_directory($path)) { file_scan_directory($path, '/.*/', ['callback' => 'file_unmanaged_delete']); + drupal_rmdir($path); - FileSystem::rmdir($path); // Change query-strings on css/js files to enforce reload for all users. _drupal_flush_css_js();