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
ae05a8de
Commit
ae05a8de
authored
Mar 11, 2012
by
webchick
Browse files
Issue
#1476812
by droplet: Fixed hooks file_field_delete_file() takes only 2 arguments.
parent
5bbf6609
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/modules/field/field.api.php
View file @
ae05a8de
...
...
@@ -567,7 +567,7 @@ function hook_field_delete($entity_type, $entity, $field, $instance, $langcode,
// be counted in hook_file_references().
$item
[
'file_field_type'
]
=
$entity_type
;
$item
[
'file_field_id'
]
=
$id
;
file_field_delete_file
(
$item
,
$field
);
file_field_delete_file
(
$item
,
$field
,
$entity_type
,
$id
);
}
}
...
...
@@ -592,10 +592,11 @@ function hook_field_delete($entity_type, $entity, $field, $instance, $langcode,
* $entity->{$field['field_name']}[$langcode], or an empty array if unset.
*/
function
hook_field_delete_revision
(
$entity_type
,
$entity
,
$field
,
$instance
,
$langcode
,
&
$items
)
{
list
(
$id
,
$vid
,
$bundle
)
=
entity_extract_ids
(
$entity_type
,
$entity
);
foreach
(
$items
as
$delta
=>
$item
)
{
// For hook_file_references, remember that this file is being deleted.
$item
[
'file_field_name'
]
=
$field
[
'field_name'
];
if
(
file_field_delete_file
(
$item
,
$field
))
{
if
(
file_field_delete_file
(
$item
,
$field
,
$entity_type
,
$id
))
{
$items
[
$delta
]
=
NULL
;
}
}
...
...
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