Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
F
filefield
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
filefield
Commits
c02fd5eb
Commit
c02fd5eb
authored
Dec 03, 2008
by
drewish
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up some PHP warnings.
parent
9ff38ea7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
field_file.inc
field_file.inc
+2
-2
filefield.module
filefield.module
+8
-4
No files found.
field_file.inc
View file @
c02fd5eb
...
...
@@ -89,7 +89,7 @@ function field_file_save_upload($source, $validators = array(), $dest = FALSE, $
if
(
!@
chmod
(
$file
->
filepath
,
0664
))
{
watchdog
(
'filefield'
,
'Could not set permissons on destination file: %file'
,
array
(
'%file'
=>
$file
->
filepath
));
}
// Let modules add additional properties to the yet barebone file object.
foreach
(
module_implements
(
'file_insert'
)
as
$module
)
{
$function
=
$module
.
'_file_insert'
;
...
...
@@ -292,7 +292,7 @@ function _field_file_cache($file = NULL, $reset = FALSE) {
// Cache the file by both fid and filepath.
// Use non-copying objects to save memory.
if
(
isset
(
$file
))
{
if
(
!
empty
(
$file
->
fid
))
{
$files
[
$file
->
fid
]
=
$file
;
$files
[
$file
->
filepath
]
=
$file
;
}
...
...
filefield.module
View file @
c02fd5eb
...
...
@@ -285,18 +285,22 @@ function filefield_widget(&$form, &$form_state, $field, $items, $delta = 0) {
if
(
empty
(
$form
[
'#submit'
])
||
!
in_array
(
'filefield_node_form_submit'
,
$form
[
'#submit'
]))
{
$form
[
'#submit'
][]
=
'filefield_node_form_submit'
;
}
$form
[
'#attributes'
]
=
array
(
'enctype'
=>
'multipart/form-data'
);
module_load_include
(
'inc'
,
'filefield'
,
'field_widget'
);
module_load_include
(
'inc'
,
$field
[
'widget'
][
'module'
],
$field
[
'widget'
][
'module'
]
.
'_widget'
);
$form
[
'#attributes'
]
=
array
(
'enctype'
=>
'multipart/form-data'
);
$item
=
array
(
'fid'
=>
0
,
'list'
=>
$field
[
'list_default'
],
'data'
=>
array
(
'description'
=>
''
));
if
(
isset
(
$items
[
$delta
]))
{
$item
=
array_merge
(
$item
,
$items
[
$delta
]);
}
$element
=
array
(
'#title'
=>
$field
[
'widget'
][
'label'
],
'#type'
=>
$field
[
'widget'
][
'type'
],
'#default_value'
=>
array_merge
(
array
(
'fid'
=>
0
,
'list'
=>
$field
[
'list_default'
],
'data'
=>
array
(
'description'
=>
''
)),
$items
[
$delta
])
,
'#default_value'
=>
$item
,
'#upload_validators'
=>
filefield_widget_upload_validators
(
$field
),
);
module_load_include
(
'inc'
,
$field
[
'widget'
][
'module'
],
$field
[
'widget'
][
'module'
]
.
'_widget'
);
return
$element
;
}
...
...
Write
Preview
Markdown
is supported
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