Correct me if I'm wrong, but it looks like flag.module is currently returning the wrong data structure from flag_field_extra_fields(). It should be:

$extra['node'][$type->type]['display']['flag'] = array();
// or
$extra['node'][$type->type]['form']['flag'] = array();

Also, each individual flag could be separated out here to allow each to be ordered/placed in the 'manage display' tab for nodes.

On top of this, I don't see any place where this would take effect since flag_node_view() ends up burying the set of flag links in content['links'].

If this is done on purpose and I'm just not getting it, no worries. If this is not the intended setup, then let me know and I'll write a patch for it.

CommentFileSizeAuthor
#2 flag_field_extra_fields2-d7.patch1.58 KBquicksketch

Comments

quicksketch’s picture

Yeah, RC3 API change. :P

Needs to be updated for sure.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.58 KB

On top of this, I don't see any place where this would take effect since flag_node_view() ends up burying the set of flag links in content['links'].

The implementation of hook_field_extra_fields() is for the form-side of things (while editing a node for example), not for the display side (since Flag links are displayed in the $links array, as you stated).

This patch fixes the implementation of hook_field_extra_fields() in several ways. First it only shows the Flag options if there are some checkboxes exposed on the node form for that node type (previously it just always showed it) and it tells you what those checkboxes are now for each type. It also removes some ancient legacy code referring to "content.module".

quicksketch’s picture

Title: Misuse of hook_field_extra_fields() » Update hook_field_extra_fields() for ordering Flag fieldset on forms

Status: Fixed » Closed (fixed)

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