-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APiv4 - Add Extension.get #22754
APiv4 - Add Extension.get #22754
Conversation
(Standard links)
|
I had understood it as not that the key/full_name field was deprecated, but that using dots was discouraged, partly because the script that made a gitlab repo out of the drupal node had problems with dots (or something), and partly for reasons I didn't really follow. |
4c23fed
to
1085a82
Compare
To expand on what I mean, if the field were deprecated, I should be able to remove it from info.xml. If I do that, the extension won't install. It also doesn't recognize when there are upgrades because the extension feed uses key/full_name. Also
It might be easier to get rid of |
I think @totten should weigh in here, but my understanding is that using dots in the |
I agree with @demeritcowboy. The distinction between I share your preference for
Right, it matches on either IMHO, for a data model to accurately describe the Civi 5.x world (ie to be useful for the range of integration scenarios that are likely to come up), it would use both names... |
Ok, so @totten in concrete terms, what do you think the output of this API should be? Currently the fields are
|
Re: label/name -- Oof, yeah, there are several authorities, and they all disagree (slightly) with each other on terminology ( To my eye, Example: But looking at that... I sorta see where you're coming from. The above subtly says that the long version ( If you want to encourage people to think of the short identifier as being equally legit.... there's a little bit of precedent for |
Tangentially: totten/civix#236 proposes a warning if you have a dot in a new extension-key. |
@totten right. I think my only problem with However, The problem with using So now I'm leaning toward your first impulse of |
@colemanw OK, A couple other thing I noticed in
|
It seems to at a glance, but it doesn't. Under the hood, the APIv4
Yes, you can do it with the NOT operator. I've updated the screenshot in the description with an example which excludes |
@totten @demeritcowboy I'm happy with this if you're ready to merge it. |
I'm good. Thanks all. |
Hmm... It also filters on |
ad2a9f8
to
5681140
Compare
@totten interesting. I hadn't tried it on the CLI. The APIv4 Explorer won't allow you to select unknown fields. cv api4 Extension.get +s key,status:label Fixed with 6d0b4f6 |
5681140
to
3c8783b
Compare
@colemanw FWIW, almost all of those errors are reporting the same thing:
I think that... if you're inclined to make this strictness global, then it might be easier to pursue that as a separate PR? The |
3c8783b
to
510b347
Compare
Overview
Ports the Extension.get API to v4.
Before
Extension API in v3 only.
After
APIv4 now exists for Extensions, but only get action so far.
Comments
I've learned that adding anything non-essential to a new API can bite you in the butt later. So this new api only supports the 'get' action as a first step, and that action returns a limited subset of what's returned by
CRM_Extension_System::createExtendedInfo
- just the stuff that's really useful and not likely to be deprecated anytime soon.This new API returns only the short version of the key (e.g.
search_kit
notorg.civicrm.search_kit
), as the long version is deprecated we might as well omit it altogether.I wasn't entirely sure what to do with the
name
andlabel
properties. It seems like the intention was thatlabel
would be a localized version of thename
, but I don't see any code in the extension system to actually translate the string to localize thelabel
, it appears to be copied fromname
as-is:civicrm-core/CRM/Extension/Info.php
Line 182 in fa3fdeb
Nevertheless this new API dutifully returns
label
(but notname
, because it's redundant and likely to get confused withkey
). IDK maybe someday labels will get translated?