-
-
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
Migrate APIv4 into civicrm-core #15309
Conversation
(Standard links)
|
c7b0e66
to
f74361a
Compare
@colemanw I've pushed up a new run of the imported code. It's sort of working -- in that this scenario seems to execute:
However, it shouldn't be necessary to set
I get a similar error when running the unit-tests:
Outstanding issues:
|
@totten I think the problem was that services weren't getting loaded. Again, it was a directory scanning issue. Services do things like permission checks :) |
@colemanw Yeah, I can see how it's doing a scan for subscribers and has been missing |
Jenkins re test this please |
@totten @coleamnw karma is throwing up an error
|
I don't get it. Afaik there are no api4 karma tests. |
@colemanw i think its globbing everything in the ang/ folder and i think its tripping on this code https://github.com/civicrm/civicrm-core/pull/15309/files#diff-c0be9ef6aab30b51901d6a52da683562R4 |
@totten it seems that most of the stuff in the root |
@colemanw @totten i found that doing this worked for me locally
|
@totten @colemanw to get the
|
@totten after checking out this branch and disabling the extension, I tried to visit the api explorer and got:
|
@colemanw @totten i had the same issue as Coleman but got the explorer working by doing the following changes
Once i got the explorer loaded i was having some javascript errors and i think it came down to the fact that in crm.ajax.js we don't define specific CRM.$ and CRM._ as $ and _ respectfully but we just have a CRM matching so things seemed to improve with the following changes
|
I should add that i haven't tried those changes with the extension active |
@seamuslee001 I opened totten#1 against this branch but am still scratching my head about why angular blows up. |
@colemanw if you look at the Angular manager you will notice that it only loads in specific .ang.php files for civicrm which I think is the issue here whilst the extension is in play the hook manages the loading of the modules take that away and because there is no glob pattern if .ang.php files the api4 moudles aren’t loaded |
Ok got it, thanks. |
@civicrm-builder retest this please |
|
@seamuslee001 that seems like an edge-case bug in our test infra. Perhaps it doesn't like a file being added and deleted within the same PR. I've just rebased the file name change into the original commit to see if that works better. |
@colemanw the style cop has logged on https://test.civicrm.org/job/CiviCRM-Core-PR/28952/checkstyleResult/new/ |
b7c71a3
to
82d8e04
Compare
Ironically, the core angular loader doesn't glob the directory so we had to add in those files by hand. @totten |
@colemanw test failures look related |
82d8e04
to
13e9117
Compare
Whoops those changes snuck in by accident |
@@ -574,7 +574,8 @@ SET @devellastID:=LAST_INSERT_ID(); | |||
INSERT INTO civicrm_navigation | |||
( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) | |||
VALUES | |||
( @domainID, 'civicrm/api', '{ts escape="sql" skip="true"}API Explorer{/ts}','API Explorer', 'administer CiviCRM', '', @devellastID, '1', NULL, 1 ), | |||
( @domainID, 'civicrm/api', '{ts escape="sql" skip="true"}Api Explorer v3{/ts}', 'API Explorer', 'administer CiviCRM', '', @devellastID, '1', NULL, 1 ), | |||
( @domainID, 'civicrm/api4#/explorer', '{ts escape="sql" skip="true"}Api Explorer v4{/ts}', 'Api Explorer v4', 'administer CiviCRM', '', @devellastID, '1', NULL, 2 ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we merge, I think we'll need to regenerate civicrm_generated.mysql
. (But I think it's OK if that waits until the "WIP" flag is done.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@totten could you generate that file pls?
jenkins, test this please |
@totten I think we're ready for that. The only outstanding issue is the explorer bootstrap theme, but we could take care of that in a subsequent PR. Someone wanna run gencode and remove the WIP tag? |
This is no longer necessary since it's part of core!
Jenkins re test this please |
Jenkins re test this please |
@totten this is passing. Just needs the menu sql generated. |
@colemanw I like the new warning: Seems like a nice way to detect whether Bootstrap is working and to also defer the topic of bootstrap-in-core (which is significant thing on its own) for another discussion/day. Tangentially, I think we need more sysadmin-facing docs about theme configuration. https://github.com/civicrm/civicrm-sysadmin-guide/issues/191 |
@totten @Coleman i performed the following test this morning
The status was I note that in the upgrade code it only checks that the status is Manager::STATUS_INSTALLED not manager::STATUS_INSTALLLED_MISSING |
@seamuslee001 thanks for the testing. I think #15343 will address it. |
Only use html5 number input when dealing with single valued input
Overview
APIv4 is a revamp of APIv3. It starts with a baseline that includes many of the values that evolved in APIv3, such as:
It also makes several improvements, such as:
APIv4 was initially developed as an extension (
org.civicrm.api4
) for CiviCRM. Developing as an extension has allowed it to go through an incubation process over a couple years (iterating quickly at first; and then refining the contract in response to real-world usage). At time of writing, the best walk-through of the technical details is the org.civicrm.api4 README file.This PR migrates the APIv4 codebase from a standalone extension (
org.civicrm.api4
) -- and intocivicrm-core
, where APIv3 and APIv4 will sit alongside each other. This migration is broadly motivated by a few observations:Before
civicrm-core
.org.civicrm.api4
andcivicrm-core
were in a bi-directional dependency with non-synchronized version numbers.After
civicrm-core
. There is no bi-directional dependency. (If the old extension is present, it will be disabled.)civicrm-core
instead oforg.civicrm.api4
. However, if a critical/security issue arises during the support window for CiviCRM <=5.18, then the correspondingorg.civicrm.api4
can be updated.Technical Details
For developers, BootstrapCSS is recommended for use with the APIv4 Explorer GUI. This has been primarily used/tested with org.civicrm.shoreditch, although it generates standard markup and aims to be compatible with other BootstrapCSS providers (CMS themes/CRM extensions).
Additional details about the migration process are tracked in civicrm/org.civicrm.api4#198.