Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3d1dcb49
Commit
3d1dcb49
authored
Nov 24, 2008
by
webchick
Browse files
Removing
#137932
which was committed prematurely.
parent
251a761e
Changes
5
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
3d1dcb49
...
...
@@ -851,7 +851,7 @@ function form_error(&$element, $message = '') {
* $_POST data.
*/
function
form_builder
(
$form_id
,
$form
,
&
$form_state
)
{
static
$complete_form
,
$cache
,
$
enctyp
e
;
static
$complete_form
,
$cache
,
$
fil
e
;
// Initialize as unprocessed.
$form
[
'#processed'
]
=
FALSE
;
...
...
@@ -864,7 +864,6 @@ function form_builder($form_id, $form, &$form_state) {
if
(
isset
(
$form
[
'#type'
])
&&
$form
[
'#type'
]
==
'form'
)
{
$cache
=
NULL
;
$enctype
=
NULL
;
$complete_form
=
$form
;
if
(
!
empty
(
$form
[
'#programmed'
]))
{
$form_state
[
'submitted'
]
=
TRUE
;
...
...
@@ -938,12 +937,6 @@ function form_builder($form_id, $form, &$form_state) {
unset
(
$form_state
[
'buttons'
]);
}
// If an element requires to set the forms content type enctype attribute, we
// need to store this info in a static $enctype flag to update the parent
// form element. E.g. For files, non-ASCII data, and binary data.
if
(
isset
(
$form
[
'#enctype'
]))
{
$enctype
=
$form
[
'#enctype'
];
}
// If some callback set #cache, we need to flip a static flag so later it
// can be found.
if
(
!
empty
(
$form
[
'#cache'
]))
{
...
...
@@ -955,15 +948,14 @@ function form_builder($form_id, $form, &$form_state) {
$file
=
TRUE
;
}
if
(
isset
(
$form
[
'#type'
])
&&
$form
[
'#type'
]
==
'form'
)
{
// Set the form encoding if required.
if
(
isset
(
$enctype
))
{
$form
[
'#attributes'
][
'enctype'
]
=
$enctype
;
}
// We are on the top form, we can copy back #cache if it's set.
if
(
isset
(
$cache
))
{
$form
[
'#cache'
]
=
TRUE
;
}
// If there is a file element, we set the form encoding.
if
(
isset
(
$file
))
{
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
}
}
return
$form
;
}
...
...
modules/system/system.admin.inc
View file @
3d1dcb49
...
...
@@ -517,6 +517,7 @@ function system_theme_settings(&$form_state, $key = '') {
}
}
}
$form
[
'#attributes'
]
=
array
(
'enctype'
=>
'multipart/form-data'
);
$form
=
system_settings_form
(
$form
);
// We don't want to call system_settings_form_submit(), so change #submit.
...
...
modules/system/system.module
View file @
3d1dcb49
...
...
@@ -341,7 +341,6 @@ function system_elements() {
$type
[
'file'
]
=
array
(
'#input'
=>
TRUE
,
'#size'
=>
60
,
'#enctype'
=>
'multipart/form-data'
,
);
...
...
modules/upload/upload.module
View file @
3d1dcb49
...
...
@@ -258,6 +258,7 @@ function upload_form_alter(&$form, $form_state, $form_id) {
}
else
{
$form
[
'attachments'
][
'wrapper'
]
+=
_upload_form
(
$node
);
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
}
}
$form
[
'#submit'
][]
=
'upload_node_form_submit'
;
...
...
modules/user/user.pages.inc
View file @
3d1dcb49
...
...
@@ -246,6 +246,7 @@ function user_profile_form($form_state, $account, $category = 'account') {
'#submit'
=>
array
(
'user_edit_delete_submit'
),
);
}
$form
[
'#attributes'
][
'enctype'
]
=
'multipart/form-data'
;
return
$form
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment