Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chris.leversuch’s picture

Status: Active » Needs review
FileSize
5.5 KB

First attempt

jhodgdon’s picture

Status: Needs review » Needs work

This looks like a good start! A few things to fix:

a)

+ * Path: admin/structure/trigger or admin/structure/trigger/(module)

- Use a list here rather than "or".
- Use the actual %whatever path specification from trigger_menu() rather than (module).

b)

+ * @param $hook
+ *   The hook that called this function
+ * @param $edit
+ *   Edit variable passed in to the hook or empty array if not needed
+ * @param $account
+ *   Account variable passed in to the hook
+ * @param $method
+ *   Method variable passed in to the hook or NULL if not needed

All of these param descriptions need to end in "."

c) There's one method in the trigger.test file that needs its verb fixed and isn't in this patch:

  /**
   * Configure an advanced action.
   *

That's all I saw -- good effort!

chris.leversuch’s picture

For a), there isn't a %whatever path, the module actually does a foreach loop and defines paths for each module:

  $trigger_info = _trigger_tab_information();
  foreach ($trigger_info as $module => $module_name) {
    $items["admin/structure/trigger/$module"] = array(
      'title' => $module_name,
...
    );
  }

Should I just use admin/structure/trigger/% in the doc?

Think I've covered the rest of your comments.

jhodgdon’s picture

We need to check what we did for some other modules that do something similar that have gone through this doc cleanup process. I think it may have been something like:
- admin/structure/trigger/MODULE, where MODULE is the machine name of a module
or maybe it was $module, since you could search for that in your code editor or browser? Anyway, we should try to be consistent with the other modules that do this (can't remember right now which ones they would be?).

chris.leversuch’s picture

Status: Needs work » Needs review

The update to node.module used:
Path: 'node/add/' . $type_url_str (part of a foreach)

Couldn't find any other examples from a quick search.

Status: Needs review » Needs work
Issue tags: -docs-cleanup-2011

The last submitted patch, 1379126-trigger_module_clean_up-1.patch, failed testing.

chris.leversuch’s picture

Status: Needs work » Needs review
Issue tags: +docs-cleanup-2011
jhodgdon’s picture

Status: Needs review » Needs work

OK let's use that model then. Two modules doing it = a pattern. :)

chris.leversuch’s picture

Status: Needs work » Needs review
FileSize
5.98 KB

Is the following OK? Not sure if both should have ' ' or neither?

+ * Path:
+ * - admin/structure/trigger
+ * - 'admin/structure/trigger/' . $module (part of a foreach)

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
5.98 KB

I think that is fine. We usually don't want '', but if you're going to concatenate with a variable, then '' makes sense. So although they're not quite parallel, I think the doc is clear and easily readable, which is the main objective after all.

Oops, I just noticed this:

- * @ingoup forms
  * @see trigger_assign_form_validate()
  * @see trigger_assign_form_submit()
+ * @ingoup forms

ingoup -> ingroup (unless the Forms page is a pile of goup? :) )

Also this:

+ * @return
+ *   Array of all triggers
 

Needs . at end of triggers.

Those are just two little fixes though... so to save time for everyone, I just edited the patch file directly and I think we're good to go.

xjm’s picture

Instead of committing this, we'll likely want to create a D7-only version of this patch pending #764558: Remove Trigger module from core.

xjm’s picture

Status: Reviewed & tested by the community » Postponed
xjm’s picture

Version: 8.x-dev » 7.x-dev
Status: Postponed » Patch (to be ported)

Alright, let's port a D7 version of this now that Trigger is not in D8.

Albert Volkman’s picture

Status: Patch (to be ported) » Needs review
FileSize
5.92 KB

D7 backport.

xjm’s picture

Status: Needs review » Needs work

This needs to have the "new" callback standards removed from the patch, as well as the Path: lines (see recent discussion in #1315992: No standard for documenting menu callbacks).

Albert Volkman’s picture

Status: Needs work » Needs review
FileSize
5.76 KB

Something like this? (also found a misspelling... "@ingoup" instead of "@ingroup")

xjm’s picture

Status: Needs review » Reviewed & tested by the community

LOL @ "ingoup".

Everything in the patch looks fine for backport now.

Note for reviewers: I verified that the following changes are correct; the parameters in D7 are called $hook and not $op.

+++ b/modules/trigger/trigger.moduleundefined
@@ -231,8 +231,8 @@ function _trigger_normalize_node_context($type, $node) {
- * @param $op
- *   Operation to trigger.
+ * @param $hook
+ *   Hook to trigger.

@@ -384,8 +384,8 @@ function trigger_comment_view($comment) {
- * @param $op
- *   Operation to trigger.
+ * @param $hook
+ *   Hook to trigger.
  */
 function _trigger_comment($a1, $hook) {
Albert Volkman’s picture

Re-reading this issue and saw that jhodgdon had already pointed out the ingoup misspelling in #10 :-)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x. Thanks!

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