Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295445

UserMultipleCancelConfirm::buildForm() using '#prefix' and '#suffix' with '#type' =>'hidden'

$
0
0

While reviewing #1946466-58: Convert all confirm_form() in user.module and user.pages.inc to the new form interface and convert route I found.

+++ b/core/modules/user/lib/Drupal/user/Form/UserMultipleCancelConfirm.phpundefined
@@ -0,0 +1,220 @@
+    $form['accounts'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
+    foreach ($accounts as $uid => $account) {
+      // Prevent user 1 from being canceled.
+      if ($uid <= 1) {
+        continue;
+      }
+      $form['accounts'][$uid] = array(
+        '#type' => 'hidden',
+        '#value' => $uid,
+        '#prefix' => '<li>',
+        '#suffix' => String::checkPlain($account->label()) . "</li>\n",
+      );

Me(@jibran) and @tim.plunkett unable to understand why '#prefix' and '#suffix' is used with '#type' => 'hidden'

Viewing all articles
Browse latest Browse all 295445


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>