Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

It looks like install_tasks() invokes both hook_install_tasks() and hook_install_tasks_alter() on the install profile (NOT on modules), so that function should probably be mentioning both. Also when you go to those hooks you cannot tell that they are invoked by this function, so that should probably be mentioned in the hook docs.

For install_run_task(), it seems like the contents of the task array are documented on the hook, so that seems like a good thing to mention in the @param $task section (say something like "... a task array as returned by hook_install_tasks()".)

Probably/hopefully a good novice task... oh I see that tag is already there.

joachim’s picture

> For install_run_task(), it seems like the contents of the task array are documented on the hook, so that seems like a good thing to mention in the @param $task section (say something like "... a task array as returned by hook_install_tasks()".)

Same for the @return value of install_tasks().

zealfire’s picture

Assigned: Unassigned » zealfire
Status: Active » Needs review
FileSize
1.74 KB

Partially comment 1 and comment 2 has been implemented in this patch.Still not sure about the way i used sentences.Also please tell me how to make changes in hook doc.I know we have to make changes in module.api.php file but not sure where to insert changes.Please review.
Thanks.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for the patch!

+      //hook_install_tasks() is invoked on the installed profile.
+        //hook_install_tasks_alter() is invoked on the installed profile.

Please put this information into the /** */ function doc header, not in-code comments.

Regarding your other question, you need to figure out where the documentation headers for the two hooks are located, and add information to them. On api.drupal.org it should tell you the file and line number for both hooks.

jrhodes07’s picture

Status: Needs work » Needs review
FileSize
2.52 KB

I added information in doc header for both hooks, I deleted a trailing white space, and I moved info from the in-line comments up into the doc block.

jhodgdon’s picture

Status: Needs review » Needs work

Looks almost perfect, thanks!

One minor change: We normally say that a hook is "invoked", not "called" -- "invoking" is a process of composing the function name and then calling the function. In this case, probably the right way to say it would be "This hook is invoked on the install profile in install_tasks()." or else "from install_tasks()", your choice. :) This is kind of important information, because most hooks are invoked on modules, and this one isn't.

And could we also add @see references in hook_install_tasks() and hook_install_tasks_alter() to each other, and in both also to install_tasks()? That is maybe slightly out of scope but would only add a couple of lines to the patch.

Thanks!

xjm’s picture

Issue tags: -Needs backport to 7.x +Needs backport to D7
er.pushpinderrana’s picture

Assigned: zealfire » Unassigned
Status: Needs work » Needs review
FileSize
3.17 KB
1.75 KB

Please review, incorporated suggestions.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Great, thanks very much!

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 1673844 and pushed to 8.0.x. Thanks!

  • alexpott committed 1673844 on 8.0.x
    Issue #2392221 by er.pushpinderrana, ClientGuy, zealfire:...
joegraduate’s picture

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

Here is a Drupal 7 backport of #11.

joegraduate’s picture

This is a slightly revised version of the patch in #12 with a minor wording clarification in the description of the return value for install_run_task() and a slight coding standards adjustment in the install_tasks_to_perform() docblock.

jhodgdon’s picture

Sigh. We would need to make those changes in Drupal 8 first.

joegraduate’s picture

Sorry, didn't mean to complicate things. #12 is basically identical to what was commited to 8.0.x.

I'd be happy to create an updated Drupal 8 patch with the changes in #13 if those changes are worth keeping.

jhodgdon’s picture

Yes, let's go back and make a new patch for D8 with those changes. Thanks!

joegraduate’s picture

Version: 7.x-dev » 8.0.x-dev
FileSize
1018 bytes

Ok, here is an updated patch for 8.0.x with the changes from #13.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! looks good for 8, then we'll return to 7 again. Waiting to commit until test bot finishes, just in case.

alexpott’s picture

Version: 8.0.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 2d149c8 and pushed to 8.0.x. Thanks!

  • alexpott committed 2d149c8 on 8.0.x
    Issue #2392221 by joegraduate, er.pushpinderrana, zealfire, ClientGuy:...
er.pushpinderrana’s picture

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

D7 patch.

joegraduate’s picture

Status: Needs review » Reviewed & tested by the community

#21 is identical to #13. Either one should be ready to commit.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 21: drupal7-revised-install-core-2392221-21.patch, failed testing.

Status: Needs work » Needs review
joegraduate’s picture

Status: Needs review » Reviewed & tested by the community

#13 and #21 (identical) both still apply cleanly against 7.x-dev. Not sure what was up with the failed test... appears to have been a fluke.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! Committed to 7.x.

  • jhodgdon committed 8f08dc9 on 7.x
    Issue #2392221 by joegraduate, er.pushpinderrana, zealfire, ClientGuy:...

Status: Fixed » Closed (fixed)

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