The documentation about the variables used in update_calculate_project_update_status is quite confusing as uses the same description for two different variables:
https://api.drupal.org/api/drupal/modules!update!update.compare.inc/func...
$project: An array containing information about a specific project.
$project_data: An array containing information about a specific project.
Currently, is hard to understand what is required in each variable if you don't read the code of the function.
Setting priority to minor, as is a quite obscure function, that no one will hardly use.
Comment | File | Size | Author |
---|---|---|---|
#2 | drupal7-confusing-variable-description-2340675-2.patch | 1.13 KB | er.pushpinderrana |
Comments
Comment #1
jhodgdonIt looks to me as though at some point, the function was changed so that $project is not used. The argument was removed in Drupal 8, but in Drupal 7 we would not have wanted to break function calls, so probably it was not removed there.
So I think what we should probably do is this:
a) Change $project argument to $unused
b) Document it as @param $unused with description "Input is not being used, but remains in function for API compatibility reasons" or something that reads better but gets this point across.
Seems like a good novice task?
Comment #2
er.pushpinderrana CreditAttribution: er.pushpinderrana commentedPlease review attached patch.
Comment #3
David Hernández CreditAttribution: David Hernández commentedThis seems correct to me. Changing it to RTBC.
Comment #5
jhodgdonThanks! Committed to 7.x. (After applying the patch, I double-checked and the new "$unused" variable is definitely not being used anywhere in that function.)