From 3fb0eded1850e2320bcc9a63f1ab9354d820c470 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Thu, 8 Jul 2021 08:09:32 +0100 Subject: [PATCH] Issue #2560447 by bojanz, longwave: Remove the undocumented, untested views_form_callback API --- core/modules/views/src/Form/ViewsFormMainForm.php | 7 +------ core/modules/views/src/ViewExecutable.php | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/core/modules/views/src/Form/ViewsFormMainForm.php b/core/modules/views/src/Form/ViewsFormMainForm.php index c9c03b718a5e..80fb39d2b3f2 100644 --- a/core/modules/views/src/Form/ViewsFormMainForm.php +++ b/core/modules/views/src/Form/ViewsFormMainForm.php @@ -107,12 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ViewExecu // If the field provides a views form, allow it to modify the $form array. $has_form = FALSE; - if (property_exists($field, 'views_form_callback')) { - $callback = $field->views_form_callback; - $callback($view, $field, $form, $form_state); - $has_form = TRUE; - } - elseif (method_exists($field, 'viewsForm')) { + if (method_exists($field, 'viewsForm')) { $field->viewsForm($form, $form_state); $has_form = TRUE; } diff --git a/core/modules/views/src/ViewExecutable.php b/core/modules/views/src/ViewExecutable.php index 7637ec8f7406..5cd0938bad89 100644 --- a/core/modules/views/src/ViewExecutable.php +++ b/core/modules/views/src/ViewExecutable.php @@ -2451,7 +2451,7 @@ public function buildThemeFunctions($hook) { */ public function hasFormElements() { foreach ($this->field as $field) { - if (property_exists($field, 'views_form_callback') || method_exists($field, 'viewsForm')) { + if (method_exists($field, 'viewsForm')) { return TRUE; } } -- GitLab