Download & Extend

hook_file_insert doc has no function body

Project:Drupal core
Version:8.x-dev
Component:documentation
Category:bug report
Priority:normal
Assigned:michaellenahan
Status:closed (fixed)
Issue tags:needs backport to D7

Issue Summary

API page: http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...

Describe the problem you have found:

No function body on hook_file_insert() doc... Needs one!

Comments

#1

Assigned to:Anonymous» michaellenahan

i'm at drupalcon london doc sprint. working on this with kay_v.

#2

Hello from DrupalCon in sunny South London.
We're at the doc sprint and have added an example.
Thanks to: bes and kay_v

AttachmentSizeStatusTest resultOperations
adding_hook_file_insert_example-1260162-2.patch1.15 KBIdleFAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in modules/system/system.api.php.View details

#3

Status:active» needs review

#4

Status:needs review» needs work

The last submitted patch, adding_hook_file_insert_example-1260162-2.patch, failed testing.

#5

Seems to have too many parens in this line:

+  if (empty($validate))) {

Also, this bit at the end of the patch needs to be removed:

diff --git a/scripts/drupal.sh b/scripts/drupal.sh
old mode 100755
new mode 100644
diff --git a/scripts/password-hash.sh b/scripts/password-hash.sh
old mode 100755
new mode 100644
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh
old mode 100755
new mode 100644

#6

Status:needs work» needs review

new patch with the fix

AttachmentSizeStatusTest resultOperations
adding_hook_file_insert_example-1260162-6.patch906 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 32,919 pass(es).View details

#7

Status:needs review» reviewed & tested by the community

Looks good, thanks for the follow-up! Should go into d7/d8 I think.

#8

Status:reviewed & tested by the community» fixed

Committed to 7.x and 8.x. Thanks!

#9

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here