Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
b354396b
Commit
b354396b
authored
18 years ago
by
Gerhard Killesreiter
Browse files
Options
Downloads
Patches
Plain Diff
#59528
, password_confirm fields don't highlight errors, patch by sammys
parent
a99b66c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
includes/form.inc
+14
-3
14 additions, 3 deletions
includes/form.inc
modules/system.module
+1
-6
1 addition, 6 deletions
modules/system.module
modules/system/system.module
+1
-6
1 addition, 6 deletions
modules/system/system.module
with
16 additions
and
15 deletions
includes/form.inc
+
14
−
3
View file @
b354396b
...
@@ -713,6 +713,18 @@ function theme_password_confirm($element) {
...
@@ -713,6 +713,18 @@ function theme_password_confirm($element) {
return
theme
(
'form_element'
,
$element
[
'#title'
],
'<div class="container-inline">'
.
$element
[
'#children'
]
.
'</div>'
,
$element
[
'#description'
],
$element
[
'#id'
],
$element
[
'#required'
],
form_get_error
(
$element
));
return
theme
(
'form_element'
,
$element
[
'#title'
],
'<div class="container-inline">'
.
$element
[
'#children'
]
.
'</div>'
,
$element
[
'#description'
],
$element
[
'#id'
],
$element
[
'#required'
],
form_get_error
(
$element
));
}
}
/*
* Expand a password_confirm field into two text boxes.
*/
function
expand_password_confirm
(
$element
)
{
$element
[
'pass1'
]
=
array
(
'#type'
=>
'password'
,
'#size'
=>
12
,
'#value'
=>
$element
[
'#value'
][
'pass1'
]);
$element
[
'pass2'
]
=
array
(
'#type'
=>
'password'
,
'#size'
=>
12
,
'#value'
=>
$element
[
'#value'
][
'pass2'
]);
$element
[
'#validate'
]
=
array
(
'password_confirm_validate'
=>
array
());
$element
[
'#tree'
]
=
TRUE
;
return
$element
;
}
/**
/**
* Validate password_confirm element.
* Validate password_confirm element.
*/
*/
...
@@ -725,13 +737,12 @@ function password_confirm_validate($form) {
...
@@ -725,13 +737,12 @@ function password_confirm_validate($form) {
form_set_value
(
$form
,
$pass1
);
form_set_value
(
$form
,
$pass1
);
if
(
$pass1
!=
$pass2
)
{
if
(
$pass1
!=
$pass2
)
{
form_error
(
$form
,
t
(
'The specified passwords do not match.'
));
form_error
(
$form
,
t
(
'The specified passwords do not match.'
));
form_error
(
$form
[
'pass1'
]);
form_error
(
$form
[
'pass2'
]);
}
}
}
}
elseif
(
$form
[
'#required'
]
&&
!
empty
(
$_POST
[
'edit'
]))
{
elseif
(
$form
[
'#required'
]
&&
!
empty
(
$_POST
[
'edit'
]))
{
form_
set_
error
(
'pass1'
,
t
(
'Password field is required.'
));
form_error
(
$form
,
t
(
'Password field is required.'
));
}
}
return
$form
;
return
$form
;
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/system.module
+
1
−
6
View file @
b354396b
...
@@ -63,12 +63,7 @@ function system_elements() {
...
@@ -63,12 +63,7 @@ function system_elements() {
$type
[
'button'
]
=
array
(
'#input'
=>
TRUE
,
'#name'
=>
'op'
,
'#button_type'
=>
'submit'
,
'#form_submitted'
=>
FALSE
);
$type
[
'button'
]
=
array
(
'#input'
=>
TRUE
,
'#name'
=>
'op'
,
'#button_type'
=>
'submit'
,
'#form_submitted'
=>
FALSE
);
$type
[
'textfield'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
60
,
'#maxlength'
=>
128
,
'#autocomplete_path'
=>
FALSE
);
$type
[
'textfield'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
60
,
'#maxlength'
=>
128
,
'#autocomplete_path'
=>
FALSE
);
$type
[
'password'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
30
);
$type
[
'password'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
30
);
$type
[
'password_confirm'
]
=
array
(
'#input'
=>
TRUE
,
$type
[
'password_confirm'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_password_confirm'
=>
array
()));
'#value'
=>
'pass'
,
'pass1'
=>
array
(
'#type'
=>
'password'
,
'#size'
=>
12
),
'pass2'
=>
array
(
'#type'
=>
'password'
,
'#size'
=>
12
),
'#validate'
=>
array
(
'password_confirm_validate'
=>
array
()),
);
$type
[
'textarea'
]
=
array
(
'#input'
=>
TRUE
,
'#cols'
=>
60
,
'#rows'
=>
5
);
$type
[
'textarea'
]
=
array
(
'#input'
=>
TRUE
,
'#cols'
=>
60
,
'#rows'
=>
5
);
$type
[
'radios'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_radios'
=>
array
()));
$type
[
'radios'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_radios'
=>
array
()));
$type
[
'radio'
]
=
array
(
'#input'
=>
TRUE
);
$type
[
'radio'
]
=
array
(
'#input'
=>
TRUE
);
...
...
This diff is collapsed.
Click to expand it.
modules/system/system.module
+
1
−
6
View file @
b354396b
...
@@ -63,12 +63,7 @@ function system_elements() {
...
@@ -63,12 +63,7 @@ function system_elements() {
$type
[
'button'
]
=
array
(
'#input'
=>
TRUE
,
'#name'
=>
'op'
,
'#button_type'
=>
'submit'
,
'#form_submitted'
=>
FALSE
);
$type
[
'button'
]
=
array
(
'#input'
=>
TRUE
,
'#name'
=>
'op'
,
'#button_type'
=>
'submit'
,
'#form_submitted'
=>
FALSE
);
$type
[
'textfield'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
60
,
'#maxlength'
=>
128
,
'#autocomplete_path'
=>
FALSE
);
$type
[
'textfield'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
60
,
'#maxlength'
=>
128
,
'#autocomplete_path'
=>
FALSE
);
$type
[
'password'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
30
);
$type
[
'password'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
30
);
$type
[
'password_confirm'
]
=
array
(
'#input'
=>
TRUE
,
$type
[
'password_confirm'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_password_confirm'
=>
array
()));
'#value'
=>
'pass'
,
'pass1'
=>
array
(
'#type'
=>
'password'
,
'#size'
=>
12
),
'pass2'
=>
array
(
'#type'
=>
'password'
,
'#size'
=>
12
),
'#validate'
=>
array
(
'password_confirm_validate'
=>
array
()),
);
$type
[
'textarea'
]
=
array
(
'#input'
=>
TRUE
,
'#cols'
=>
60
,
'#rows'
=>
5
);
$type
[
'textarea'
]
=
array
(
'#input'
=>
TRUE
,
'#cols'
=>
60
,
'#rows'
=>
5
);
$type
[
'radios'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_radios'
=>
array
()));
$type
[
'radios'
]
=
array
(
'#input'
=>
TRUE
,
'#process'
=>
array
(
'expand_radios'
=>
array
()));
$type
[
'radio'
]
=
array
(
'#input'
=>
TRUE
);
$type
[
'radio'
]
=
array
(
'#input'
=>
TRUE
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment