According to actions.inc, actions should conform to various doxygen standards @ingroup, @see
http://drupalcode.org/viewvc/drupal/drupal/includes/actions.inc?revision...

But many aren't, e.g. in node.module

Comments

jhodgdon’s picture

Title: Actions should be @ingroup actions » Actions topic group needs more functions included and better doc header

That is true, good catch! It looks like only the comment module actions are listed on http://api.drupal.org/api/group/actions/7

Also, the doxygen for the defgroup there is lame and shouldn't be telling people how to add @ingroup, but instead describing what the group is.

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new11.63 KB

Here's a patch...

willmoy’s picture

Nitpick: "Action function: ..."

Nearest thing to a standard seems to be "Action to..."
http://api.drupal.org/api/search/7/_action

Whether or not that matters, I think "Action: ..." would suffice.

Double space here in system_goto_action()
"+ * - 'url': URL to redirect to. This will be passed through"

Even bigger nckpick: technically, a colon is not followed by a capital letter.

Really sound and worthwhile patch, other than those tiny things. Could happily see it committed as is.

jhodgdon’s picture

Status: Needs review » Needs work

OK.

jhodgdon’s picture

StatusFileSize
new11.35 KB

Regarding:

Double space here in system_goto_action()
"+ * - 'url': URL to redirect to. This will be passed through"

That is intentional. It's part of a bullet list.

Regarding all of the "Action function:" things... I don't know what I was thinking. :) I removed all of them. All of the functions are marked "@ingroup actions" and that should be good enough.

Anyway, here's a new patch.

jhodgdon’s picture

Status: Needs work » Needs review
willmoy’s picture

Nice, thanks. I'm fine with this but will leave to someone else to RTBC.

@jhodgdon The two spaces I was referring to weren't around the bullet list, they were those in the middle of "redirect to. This will be" don't know if that was clear.

jhodgdon’s picture

StatusFileSize
new11.35 KB

Ah! No, I missed those. Dang.

Do you know why I do that from time to time? Because I learned to type on a typewriter, and back then, we were always told to put two spaces after the end of a sentence. It's a hard habit to break when it costs you points on your work in 8th grade (and there wasn't any easy way to backspace and fix things back then either).

Yes, I'm almost as old as the dinosaurs. :)

Anyway, here's the last patch with the double space removed. Thanks!

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

As wilmoy is happy with it and so am I, I'll tentatively mark as RTBC. Doc cleanup only anyway...

willmoy’s picture

Totally reasonable, I agree.

dries’s picture

Status: Reviewed & tested by the community » Fixed

More documentation goodies. Committed to CVS HEAD. Thanks.

jhodgdon’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)

A 6.x port of this might be useful...

albert volkman’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new10.44 KB

D6 backport.

albert volkman’s picture

StatusFileSize
new468 bytes

Also, here's a small patch for the documentation project that was included in the upstream version. Not sure if I should put it here or create a new issue.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks!

RE patch in #14 - that is fine, I can commit it from here to the docs project.

RE patch in #13, it looks good except this one line:

+ * @param $node
+ + *   A node object to modify.
jhodgdon’s picture

That #14 patch has been committed to the docs repository.

albert volkman’s picture

Status: Needs work » Needs review
StatusFileSize
new10.44 KB

Thanks!

jhodgdon’s picture

Status: Needs review » Needs work

Uh oh, one more thing:

 /**
- * Implementation of a configurable Drupal action. Sends an email.
+ * Sends an e-mail message.
+ *
+ * @param object $entity
+ *   An optional node object, which will be added as $context['node'] if
+ *   provided.
+ * @param array $context
+ *   Array with the following elements:
+ *   - 'recipient': E-mail message recipient. This will be passed through
+ *     token_replace().
+ *   - 'subject': The subject of the message. This will be passed through
+ *     token_replace().
+ *   - 'message': The message to send. This will be passed through
+ *     token_replace().
+ *   - Other elements will be used as the data for token replacement.
+ *
+ * @ingroup actions
  */
 function system_send_email_action($object, $context) {
 

@param $entity, but the actual param name is $object here. Also I don't think we're generally putting param/return types in for Drupal 6?

The same is true for the next few functions in the patch.

I didn't yet check the array elements in $context for these functions either.

albert volkman’s picture

The array elements for context are hook, node, comment, account, and recipient.

$object is a node object I believe (if it hasn't been passed through $context['node']).

I'm not hot at writing documentation, so whatever wording makes sense for each of those items.

jhodgdon’s picture

Oh, your documentation is clear. I just meant I hadn't checked it against the function code itself (kind of a busy day). That was a reminder to myself for the full review that I need to check that in order to give the documentation a thorough review. Sometimes things change between Drupal versions...

jhodgdon’s picture

Version: 6.x-dev » 7.x-dev
Issue summary: View changes
Status: Needs work » Closed (fixed)

I am cleaning up old 6.x documentation issues. At this point, we are not spending effort fixing them. Sorry.

This one started as D7 and was fixed, so setting back to taht.