Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / redirect / modules / redirect_404 / src / SqlRedirectNotFoundStorage.php
index eb2e9275e5854885208d75fc54843f61f77c6deb..8b425e9ba02ea7b223b70e351c4ad1dafb8d5fac 100644 (file)
@@ -92,6 +92,11 @@ class SqlRedirectNotFoundStorage implements RedirectNotFoundStorageInterface {
   public function purgeOldRequests() {
     $row_limit = $this->configFactory->get('redirect_404.settings')->get('row_limit');
 
+    // In admin form 0 used as value for 'All' label.
+    if ($row_limit == 0) {
+      return;
+    }
+
     $query = $this->database->select('redirect_404', 'r404');
     $query->fields('r404', ['timestamp']);
     // On databases known to support log(), use it to calculate a logarithmic