From 3e1b4793a205f5ee44ab03395a9379ad22a80cb5 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 17 Nov 2010 04:10:52 +0000
Subject: [PATCH] - Patch #953914 by chx, yched, pifantastic:
 #limit_validation_errors() fails is parents array contains numeric indexes.

---
 includes/form.inc           | 2 +-
 modules/user/user.admin.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/includes/form.inc b/includes/form.inc
index 02f82725e1a5..fe98eaee1db7 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1449,7 +1449,7 @@ function form_set_error($name = NULL, $message = '', $limit_validation_errors =
         // so errors for this element must be recorded. As the exploded array
         // will all be strings, we need to cast every value of the section
         // array to string.
-        if (explode('][', $name, count($section)) === array_map('strval', $section)) {
+        if (array_slice(explode('][', $name), 0, count($section)) === array_map('strval', $section)) {
           $record = TRUE;
           break;
         }
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 701a7888504c..123d0c1e0ed1 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -767,7 +767,7 @@ function theme_user_admin_permissions($variables) {
         'class' => array('permission'),
       );
       foreach (element_children($form['checkboxes']) as $rid) {
-        $form['checkboxes'][$rid][$key]['#title'] = $roles[$rid] . ': ' . t($key);
+        $form['checkboxes'][$rid][$key]['#title'] = $roles[$rid] . ': ' . $form['permission'][$key]['#markup'];
         $form['checkboxes'][$rid][$key]['#title_display'] = 'invisible';
         $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => array('checkbox'));
       }
-- 
GitLab