Novice task:
In the first few comments on this issue, an analysis was done to find out which operations could be invoked by the _field_invoke() function, back when it existed for 8.x (it doesn't now). This needs to be repeated for Drupal 7.x.
Then we need to verify:
a) _field_invoke() documents all of these as possible values for $op.
b) Hook documentation exists for all of the hooks implied.
And if there are missing documentation items for (a) or (b), we also need to fix the documentation.
-------------------- Original issue report
API page: http://api.drupal.org/api/drupal/modules%21field%21field.attach.inc/func...
Enter a descriptive title (above) relating to _field_invoke, then describe the problem you have found:
$b The $form_state in the 'submit' operation.
Hmm there is no 'submit' operation mentioned for $op.
(p.s. In my optinion none of the "Category" for Issue Informations fits, when I report documentation stuff.)
Comments
Comment #1
jhodgdonIf there is some incorrect or missing documentation, that is a documentation bug. :)
Thanks for reporting this. It looks like someone needs to go through all the functions that call _field_invoke() and figure out what the "operations" actually can be and what the arguments can be. I don't think there is actually a "submit" operation, because the operations should correspond to hooks called hook_field_[OPERATION], and there is not a hook_field_submit.
Should be a good Novice project, I think?
Comment #2
jhodgdonforgot tag
Comment #3
mjonesdinero commentedwhat things need to be done here?
i am not sure of the description.., but the issue want to have all the operations and arguments be documented?
is this correct?
Comment #4
jhodgdonSee comment #1 for what needs to be done. Yes, all the operations and arguments need to be documented. Thanks!
Comment #5
albert volkman commentedGrepping through 8.x code, I only see the following $op's being passed-
delete
delete_revision
insert
presave
prepare_translation
update
validate
Which removes the need for these-
form
insert
view
and renames-
delete revision
prepare translation
Comment #6
jhodgdonThanks for the research! Do all of those also exist as hooks?
Comment #7
albert volkman commentedAh, I didn't take into account _field_invoke_default(). I found these additionally-
extract_form_values
form
form_errors
insert
prepare_view
submit
view
As far as existing as hooks-
core/modules/field/field.default.inc
field_default_extract_form_values($entity_type, $entity, $field, $instance, $langcode, &$items, $form, &$form_state)
field_default_insert($entity_type, $entity, $field, $instance, $langcode, &$items)
field_default_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode)
field_default_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $display)
field_default_submit($entity_type, $entity, $field, $instance, $langcode, &$items, $form, &$form_state)
field_default_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors)
field_default_view($entity_type, $entity, $field, $instance, $langcode, $items, $display)
core/modules/field/field.form.inc
field_default_form($entity_type, $entity, $field, $instance, $langcode, $items, &$form, &$form_state, $get_delta = NULL)
field_default_form_errors($entity_type, $entity, $field, $instance, $langcode, $items, $form, &$form_state)
core/modules/field/field.api.php
hook_field_delete($entity_type, $entity, $field, $instance, $langcode, &$items)
hook_field_delete_revision($entity_type, $entity, $field, $instance, $langcode, &$items)
hook_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items)
hook_field_update($entity_type, $entity, $field, $instance, $langcode, &$items)
Comment #8
jhodgdonSo, you're saying there are only 4 hooks documented in field.api.php, but there are about 10 that can be invoked via _field_invoke()? That's not good... Should we expand the scope of this issue to make sure these hooks are all documented at the same time?
Comment #9
msherron commentedWorking on this issue.
Comment #10
msherron commentedThe current issue is marked as 8.x, but this function no longer exists (_field_invoke). I'm working at the DrupalCon Austin sprint and double checked with my mentor. Marking as needs review.
Comment #11
jhodgdonThanks! Yes this issue is quite old and fields are now plugins, so there is not a field invoke equivalent in Drupal 8 now.
We need to redo this analysis in the first few comments for Drupal 7. Issue summary kind of updated (at least to describe this task).
Comment #12
Lal_