Problem/Motivation
Follow-up from #3066801: Add hook_removed_post_updates().
It would be useful to be able to link to contrib module project homepages from the error message added in that issue, so that people can quickly go and see which versions are available.
We can't assume the project homepage is on Drupal.org - it could be a github repo or similar.
Comments
Comment #2
xmacinfoA “homepage” key already exists in composer files. Can core parse that value?
Comment #3
xjmFor what it is worth, I am not sure this all that desirable, especially since we want to reduce the re-implementation of Composer features in our dependency parsing functionality. (See #3005229: Provide optional support for using composer.json for dependency metadata.)
Comment #4
dwwRe: #2: There's not necessarily an accurate composer.json to parse. Even if we had #3005229: Provide optional support for using composer.json for dependency metadata that's still optional. And we could be dealing with a custom module that doesn't have a project homepage.
Comment #5
catchRelying on the value in composer.json once we support it would be OK I think. We'd still need to decide when and how to expose it to users (apart from the error messages for missimg updates).
Comment #6
xjmObviously, it wouldn't be included if empty.
Comment #7
dwwFWIW, the release history XML includes a 'link' value:
https://updates.drupal.org/release-history/token/current
That's what the available updates report uses for this, which is why project names are links at /admin/reports/updates and /admin/reports/updates/update
If update.module is enabled, we could have an API to get project info from it. But a) not everyone turns on update.module and b) there's some weirdness with what update.module would do if it hasn't fetched data yet.
Alternatively, the d.o packaging script could easily add a 'homepage' key to all .info files while it's inserting the right 'project' and 'version' keys, although I know some folks don't like that packaging is touching the .info files at all. Adding #3036459: Packaging info from .info.yml often creates conflicts when patching as related. That's obviously way out of scope here, too, but raising it for consideration.
Regardless, everything would have to be able to handle cases where there's no value, for all the possible reasons:
Given that update.module already handles this for itself, I'm not sure how many other spots in core would care about this. ;) Maybe this is/should be headed for "won't fix". Quick brainstorm of possible uses:
Can anyone think of any other spots that might want this? I'm not going to bother with a summary update for all this unless it's more clear this is actually worth pursuing...
Thanks,
-Derek
Comment #8
plachThis kind of changes should target 9.1.x now, thanks!