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
7c5d1bd1
Commit
7c5d1bd1
authored
13 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#1260162
by michaellenahan, Bès: hook_file_insert() doc has no function body.
parent
1d3b16fc
No related branches found
No related tags found
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/system/system.api.php
+7
-3
7 additions, 3 deletions
modules/system/system.api.php
with
7 additions
and
3 deletions
modules/system/system.api.php
+
7
−
3
View file @
7c5d1bd1
...
...
@@ -2627,17 +2627,21 @@ function hook_file_presave($file) {
/**
* 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
* created by an upload.
*
* @param $file
* The file that
is about to be sav
ed.
* The file that
has been add
ed.
*
* @see file_save()
*/
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.'
);
}
}
/**
...
...
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