Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.If I want to get a list of non-deleted platforms, I can use _hosting_get_platforms().
If I want to get a list of non-disabled platforms, I can use _hosting_get_enabled_platforms().
What if I want to get a list of non-deleted non-disabled platforms?
Then I have to use:
array_intersect(_hosting_get_enabled_platforms(), _hosting_get_platforms())
which is somewhat weird.
Why don't we just add an enabled_only flag to _hosting_get_platforms(), and deprecate _hosting_get_enabled_platforms()?
_hosting_get_enabled_platforms() currently crashes PDO anyway as its "h.blah" parameter names aren't valid.
I'll have a patch for this in a minute.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hosting-deprecate_hosting_get_enabled_platforms-2721949-2.patch | 2.95 KB | colan |











Comments
Comment #2
colanHere it is.
Comment #3
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedSo you're saying _hosting_get_enabled_platforms() doesn't work at all? We should probably remove it altogether then, if one could have been using it.
I haven't tested the patch yet but it looks good.
Comment #4
colanI don't know if it works for anyone else, but when I use it, I get:
If I remove all of the dots from the parameters, then it works. This is already done in _hosting_get_platforms().
Besides some core use (which we could fix ourselves), there could be contribs out there using it that aren't running into this issue. So I'd feel more comfortable:
Comment #6
gboudrias CreditAttribution: gboudrias at Praxis Labs Coop commentedOkay, since we're not removing anything there's no big risk.
I tested the patch on my dev server.
Comment #7
colanThanks. 4.x issue created over at #2722641: Remove _hosting_get_enabled_platforms().