diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index 2fd33bf..6fa98d2 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -2237,4 +2237,28 @@ public function buildThemeFunctions($hook) {
     return $themes;
   }
 
+  /**
+   * Determines if this view has form elements.
+   *
+   * @return bool
+   *   Returns TRUE if this view contains handlers with views form
+   *   implementations, FALSE otherwise.
+   */
+  public function hasFormElements() {
+    foreach ($this->field as $field) {
+      if (property_exists($field, 'views_form_callback') || method_exists($field, 'viewsForm')) {
+        return TRUE;
+      }
+    }
+    $area_handlers = array_merge(array_values($this->header), array_values($this->footer));
+    $empty = empty($this->result);
+    foreach ($area_handlers as $area) {
+      if (method_exists($area, 'viewsForm') && !$area->viewsFormEmpty($empty)) {
+        return TRUE;
+      }
+    }
+
+    return FALSE;
+  }
+
 }
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 1959cd8..1a5a553 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -927,26 +927,6 @@ function views_get_view($name) {
 }
 
 /**
- * Returns TRUE if the passed-in view contains handlers with views form
- * implementations, FALSE otherwise.
- */
-function views_view_has_form_elements($view) {
-  foreach ($view->field as $field) {
-    if (property_exists($field, 'views_form_callback') || method_exists($field, 'viewsForm')) {
-      return TRUE;
-    }
-  }
-  $area_handlers = array_merge(array_values($view->header), array_values($view->footer));
-  $empty = empty($view->result);
-  foreach ($area_handlers as $area) {
-    if (method_exists($area, 'viewsForm') && !$area->viewsFormEmpty($empty)) {
-      return TRUE;
-    }
-  }
-  return FALSE;
-}
-
-/**
  * Replaces views substitution placeholders.
  *
  * @param array $element
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 754fe8e..0fbcc6b 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -130,7 +130,7 @@ function template_preprocess_views_view(&$variables) {
   }
 
   // If form fields were found in the view, reformat the view output as a form.
-  if (views_view_has_form_elements($view)) {
+  if ($view->hasFormElements()) {
     // Copy the rows so as not to modify them by reference when rendering.
     $rows = $variables['rows'];
     // Only render row output if there are rows. Otherwise, render the empty
