Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/core%21includes%21install.core.inc/fun...
These should both refer to hook_install_tasks(), which documents the structure of the $task array.
Comment | File | Size | Author |
---|---|---|---|
#21 | drupal7-revised-install-core-2392221-21.patch | 3.24 KB | er.pushpinderrana |
#17 | revised-install-core-2392221-17.patch | 1018 bytes | joegraduate |
#13 | interdiff.txt | 422 bytes | joegraduate |
#13 | drupal7-revised-install-core-2392221-13.patch | 3.24 KB | joegraduate |
#12 | drupal7-revised-install-core-2392221-12.patch | 3.24 KB | joegraduate |
Comments
Comment #1
jhodgdonIt 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.
Comment #2
joachim CreditAttribution: joachim commented> 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().
Comment #3
zealfire CreditAttribution: zealfire commentedPartially 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.
Comment #4
jhodgdonThanks for the patch!
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.
Comment #5
jrhodes07 CreditAttribution: jrhodes07 commentedI 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.
Comment #6
jhodgdonLooks 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!
Comment #7
xjmComment #8
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedPlease review, incorporated Comment #6 suggestions.
Comment #9
jhodgdonGreat, thanks very much!
Comment #10
alexpottThis 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!
Comment #12
joegraduateHere is a Drupal 7 backport of #11.
Comment #13
joegraduateThis 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.
Comment #14
jhodgdonSigh. We would need to make those changes in Drupal 8 first.
Comment #15
joegraduateSorry, 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.
Comment #16
jhodgdonYes, let's go back and make a new patch for D8 with those changes. Thanks!
Comment #17
joegraduateOk, here is an updated patch for 8.0.x with the changes from #13.
Comment #18
jhodgdonThanks! looks good for 8, then we'll return to 7 again. Waiting to commit until test bot finishes, just in case.
Comment #19
alexpottCommitted 2d149c8 and pushed to 8.0.x. Thanks!
Comment #21
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedD7 patch.
Comment #22
joegraduate#21 is identical to #13. Either one should be ready to commit.
Comment #25
joegraduate#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.
Comment #26
jhodgdonThanks all! Committed to 7.x.