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

jhodgdon’s picture

Title: There is no 'submit' operation mentioned for $op. » There is no 'submit' operation mentioned for $op in _field_invoke()
Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

If 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?

jhodgdon’s picture

Issue tags: +Novice

forgot tag

mjonesdinero’s picture

what 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?

jhodgdon’s picture

See comment #1 for what needs to be done. Yes, all the operations and arguments need to be documented. Thanks!

albert volkman’s picture

Grepping 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

jhodgdon’s picture

Thanks for the research! Do all of those also exist as hooks?

albert volkman’s picture

Ah, 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)

jhodgdon’s picture

So, 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?

msherron’s picture

Assigned: Unassigned » msherron
Issue summary: View changes

Working on this issue.

msherron’s picture

Status: Active » Needs review

The 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.

jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs review » Active
Issue tags: -Needs backport to D7

Thanks! 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).

Lal_’s picture

Assigned: msherron » Lal_

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.