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.
For various forms within the Aegir system, it would be nice to provide autocomplete text fields so users can select site names. Let's place this functionality within Sites, as that's where it should go.
In order to work with these values, we need to be able to figure out the node ID of the selected site from the selected name so that we can do something with it.
I'll have a patch for this in a minute.
Comments
Comment #2
colanComment #3
colanTo see a use case for this, see #2712701: Make settings fields user-friendly instead of requesting node IDs.
Comment #4
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedhosting_get_site_by_url() is used in a few places: http://api.aegirproject.org/api/Hosting/site!hosting_site.module/functio...
Your version uses the DB API, which is of course better, so as long as you already wrote the code we could swap it in. The original function returns the whole node though, it would be important not to change this if we go that way.
Comment #5
colanHopefully this patch gives us what we want.
I made the following changes:
Comment #7
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedWorks great, committed.