With the new v6.x-2.x on the way, and v7.x-2.x, it would be useful to have some API documentation bundled rather than having to read through the module's code.

Comments

damienmckenna’s picture

I think the first thing would be to build a list of the hooks available.

  • hook_flag
  • hook_flag_access
  • hook_flag_access_multiple
  • hook_flag_alter
  • hook_flag_default_flags
  • hook_flag_definitions
  • hook_flag_link
  • hook_flag_link_types

Any others I missed?

tim.plunkett’s picture

hook_flag_reset

stevector’s picture

This is needed for 7.x as well

joachim’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Upping the version.

joachim’s picture

Category: task » bug
Priority: Normal » Major

Upping the priority. People can't on this module without proper docs -- missing docs is a bug.

I'll make a start on figuring this out later.

socketwench’s picture

I hate to admit it, but I love writing docs. Shall I pick up this task?

joachim’s picture

I've made an initial stab at this: http://drupalcode.org/project/flag.git/blob/refs/heads/7.x-2.x:/flag.api...

A lot of these are a total mystery to me. If anyone could provide a one-line summary of any or all of them here, that would be a big help.

socketwench’s picture

We could try backtracing the hooks to the module_invoke()s elsewhere in the code? That may give us some idea what some of them do.

joachim’s picture

I've been doing that.

I also tweeted at quicksketch, because it would be far more efficient to get the knowledge out of a brain that (perhaps still) contains it. No reply though.

joachim’s picture

All the hooks in the api.php file now have documentation, and I believe all our hooks are listed.

Leaving this open as it would be nice for them to have example code too.

joachim’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

I missed hook_flag_export_alter().

joachim’s picture

Issue tags: +Novice

Tagging as novice.

Things still to do:

- add hook_flag_export_alter()
- add some stub code for each hook, using flag's own implementations as a starting point

I'll happily take partial patches!

joachim’s picture

Title: API documentation » API documentation: fill in sample code for hooks
Category: bug » task
Priority: Major » Normal

I've added docs for hook_flag_export_alter().

Downgrading this to a normal task.

  • joachim committed 303a9ef on 8.x-4.x
    Issue #970052, part 1 by joachim: Added api documentation file, not all...
  • joachim committed dec78cf on 8.x-4.x
    Issue #970052, part 2 by joachim: Added further documentation to api.php...
ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -Novice

Closed as outdated because Drupal 7 is EOL