Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
225
Merge Requests
225
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
7c5d1bd1
Commit
7c5d1bd1
authored
Sep 11, 2011
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#1260162
by michaellenahan, Bès: hook_file_insert() doc has no function body.
parent
1d3b16fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
modules/system/system.api.php
modules/system/system.api.php
+7
-3
No files found.
modules/system/system.api.php
View file @
7c5d1bd1
...
@@ -2627,17 +2627,21 @@ function hook_file_presave($file) {
...
@@ -2627,17 +2627,21 @@ function hook_file_presave($file) {
/**
/**
* Respond to a file being added.
* Respond to a file being added.
*
*
* This hook is called
before
a file has been added to the database. The hook
* This hook is called
after
a file has been added to the database. The hook
* doesn't distinguish between files created as a result of a copy or those
* doesn't distinguish between files created as a result of a copy or those
* created by an upload.
* created by an upload.
*
*
* @param $file
* @param $file
* The file that
is about to be sav
ed.
* The file that
has been add
ed.
*
*
* @see file_save()
* @see file_save()
*/
*/
function
hook_file_insert
(
$file
)
{
function
hook_file_insert
(
$file
)
{
// Add a message to the log, if the file is a jpg
$validate
=
file_validate_extensions
(
$file
,
'jpg'
);
if
(
empty
(
$validate
))
{
watchdog
(
'file'
,
'A jpg has been added.'
);
}
}
}
/**
/**
...
...
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