foreach (drupal_get_installed_schema_version(NULL, FALSE, TRUE) as $module => $schema_version) {
The function's documentation doesn't say this usage is valid.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | drupal_get_installed_schema_version-3037786-3.patch | 1.04 KB | maliknaik |
Comments
Comment #3
maliknaik commentedModified the doc block.
Comment #4
maliknaik commentedComment #5
joachim commentedThat's a good start, but it shoul also say what it means to pass in NULL.
Comment #6
mmjvb commentedAnd returning an array in addition to string|int.
Comment #7
maliknaik commentedWhen the first parameter is set to NULL then it gets the information about all the modules in the system.
Comment #8
mmjvb commentedNo, it always gets all versions upon first call. Only when $array is TRUE it returns all. Which is why it needs the array added as return value. The $module is irrelevant/disgarded when $array is TRUE. So, it could be NULL, but its value is ignored/not used. When $array is FALSE, $module shouldn't be NULL and it returns SCHEMA_UNINSTALLED when it does.
Comment #9
maliknaik commented@mmjvb, I've added the array as one of the return type and also changed the description for the first parameter.
Comment #10
mmjvb commentedThe description of the return type should mention it returns the version of each discovered module (array), the version of module requested (string), SCHEMA_UNINSTALLED (int) when that module is uninstalled from database.
Comment #11
maliknaik commented@mmjvb, I've updated the description.
Oops, I've added the wrong patches previously.
Comment #12
mmjvb commentedAlthough I am not native speaker, believe that description not to be a proper sentence. Couldn't find a proper example that quickly on explaining the @return. There might even be standards for it. Maybe somebody else knows.
Comment #13
maliknaik commentedComment #18
quietone commentedThanks everyone for working on this.
Looking into this I find that this has been addressed in #2124069: Convert schema.inc to the update.update_hook_registry service (UpdateHookRegistry). Therefor closing as a duplicate.