Description

Hooks in Drupal are documented with a standard API documentation header describing the arguments and return value, and a function body giving an example of how to implement the hook. There are 18 new Drupal 7 hooks in the Field API that are missing sample function bodies. So the task is to create sample implementation function bodies for these hooks.

The hooks that need function bodies are in modules/field/field.api.php, and they are the following:
hook_field_attach_form
hook_field_attach_load
hook_field_attach_validate
hook_field_attach_submit
hook_field_attach_presave
hook_field_attach_insert
hook_field_attach_update
hook_field_attach_preprocess_alter
hook_field_attach_delete
hook_field_attach_delete_revision
hook_field_storage_pre_load
hook_field_create_field
hook_field_create_instance
hook_field_delete_field
hook_field_update_instance
hook_field_delete_instance
hook_field_read_field
hook_field_read_instance

Deliverables

A patch against Drupal 7 HEAD containing the function bodies needs to be created and attached to the issue:
#675116: field.api.php hook documentation is incomplete
The student should also respond to any reviews of the patch, and revise until it has been marked "reviewed and tested by the community" and ideally, committed to Drupal 7's code base.

Resources

http://code.google.com/p/google-highly-open-participation-drupal/wiki/Fu...
http://drupal.org/patch/create (How to create a patch)
http://drupal.org/handbook/cvs (CVS information)
http://drupal.org/node/320 (checking out the main CVS repository)
http://drupal.org/node/1354#hooks (standards for how to document hooks)

Primary Contact

jhodgdon - Jennifer Hodgdon - you can find me on IRC or use the contact form on my user profile (there should be a link to that as I'm the author of this issue)

Drupal Issue

#675116: field.api.php hook documentation is incomplete

Comments

webchick’s picture

Status: Active » Reviewed & tested by the community
Issue tags: -gci-proposal +gci-task

Excellent work. Ship it!

cwgordon7’s picture

This looks great, thanks!

cwgordon7’s picture

Hi jhodgdon,

Please make an account on the google application site and apply to be a mentor for Drupal, so I can add this task. It needs a mentor listed on the google system. You can apply here: http://socghop.appspot.com/gci/mentor/request/google/gci2010/drupal. Thanks!

cwgordon7’s picture

Hi jhodgdon,

Could you also estimate the time, in hours, that it would take a student to complete this task once it is claimed? This estimate is required to input the task into the google system. Thanks!

jhodgdon’s picture

I think/hope I've applied to become a mentor under the name jhodgdon/Jennifer Hodgdon on that system.

Let's see, a time estimate. There are 18 hooks that need function bodies written. None of them have example implementations in core, though there might be examples in contrib that can be researched/borrowed. So I would say each one might take half an hour to think up a reason that it might be called and write a short sample function body, for someone who is already familiar with the Field API, Drupal hooks in general, and our coding standards. Then there might be some back and forth, reformatting of patches, etc... let's say 15 hours? It's hard to estimate... Of course, this wouldn't include any learning that would need to be done, for someone with less familiarity with Field API etc. Does that sound about right? Feel free to disagree.

jhodgdon’s picture

I am sorry, but why does Google need all that information? I am not really enthused about providing them with my birth date, for instance.

jhodgdon’s picture

Perhaps yched or bjaspan would be better mentors for this project anyway? I really don't know why they added these hooks, so I'm not sure what the use cases would be.

vosechu’s picture

jhodgdon: would you be willing to talk to bjaspan or yched about taking over mentorship? If you really want them to, I'm confident that you're more than qualified to mentor this task.

Also, regarding the birthdate and shipping address, my read was that there were plans to ship tshirts to mentors. Not sure about the dob though, maybe there's a minimum age for mentors? Though that does seem silly since some of our brightest are not yet 18.

jhodgdon’s picture

I'll put in a fake DOB -- I'm just concerned about identity theft these days. Address -- not a big secret.

jhodgdon’s picture

OK, I'll be the mentor and I've registered.

dawehner’s picture

Status: Reviewed & tested by the community » Active
dawehner’s picture

Project: Google Code-in » Drupal core
Version: » 7.x-dev
Component: Documentation » documentation

.

jhodgdon’s picture

Ummm. We already have a separate issue for the actual documentation project here:
#675116: field.api.php hook documentation is incomplete

So should we just close this issue as a duplicate?

webchick’s picture

Sure. Just make sure Melange points to the right thing.

jhodgdon’s picture

Status: Active » Closed (duplicate)

Yes.
http://www.google-melange.com/gci/task/show/google/gci2010/drupal/t12904...
references
http://drupal.org/node/675116
and there is no mention there of this issue. So, closing this issue as a duplicate at this point. I'm also adding the tags from this issue to 675116.