Skip to content
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

CRM-17867 - Api4 core patches #7725

Merged
merged 10 commits into from
Oct 11, 2016
Merged

CRM-17867 - Api4 core patches #7725

merged 10 commits into from
Oct 11, 2016

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Feb 3, 2016

Most of api4 is in an extension - these are the changes needed to core.


@colemanw colemanw added the needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state label Feb 3, 2016
@colemanw colemanw force-pushed the api4 branch 3 times, most recently from 5e633fd to 91f19f2 Compare February 3, 2016 03:48
@colemanw
Copy link
Member Author

colemanw commented Feb 4, 2016

jenkins test this please

@totten
Copy link
Member

totten commented Feb 16, 2016

@colemanw , for the issue of the kernel test failures, it's OK to change Civi\API\KernelTest::MOCK_VERSION from 99 to 3.

I used a mock-version of 99 to avoid unintentional conflicts between (a) the isolated/fake test entity and (b) the normal runtime entities. However, that was mostly theoretical/preventive, and we're not likely to get a conflict on the Widget.frobnicate API.

https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/Civi/API/KernelTest.php#L9

}
$query->limit = $options['limit'];
$query->offset = $options['offset'];
$query->checkPermissions = CRM_Utils_Array::value('check_permissions', $params, FALSE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: the failed test. I don't believe it's a problem with the hook infrastructure. Look at this:

  1. Here in basic_get(), it calls the constructor (new Api3SelectQuery()) and then sets the checkPermissions property.
  2. Inside the constructor, it calls $this->query->where($this->getAclClause(self::MAIN_TABLE_ALIAS, $baoName));. At that point, checkPermissions still has its default value (false).
  3. Inside getAclClause(), it short-circuits because checkPermissions is false.

I took a stab at this with f62e540. It might need a similar patch for Api4SelectQuery.

@colemanw
Copy link
Member Author

colemanw commented Mar 6, 2016

jenkins, retest this please

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

test this please

@litespeedmarc
Copy link
Contributor

Talking with @colemanw today during spring coding. Giving an update this, and hence a heart beat on this patch. It is still alive, he's just had no chance to get to back to Api V4 stuff.

This continues to be WIP, shouldn't get merged yet, until we know more about how ApiV4 will work and is complete -- avoiding to WAGNI core until then.

Recommends to follow-up in a couple months still, leaving open until then

@litespeedmarc litespeedmarc changed the title CRM-17867 - Api4 core patches (WIP) CRM-17867 - Api4 core patches Sep 27, 2016
@litespeedmarc litespeedmarc added needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state and removed needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state labels Sep 27, 2016
@seamuslee001
Copy link
Contributor

Jenkins re test this please

The unconditional translation of financial_type to contribution_type
was messing up a few tests. This seems more sensible anyway.
@seamuslee001
Copy link
Contributor

I ran AUG's unit tests against 4.7 with this patch and couldn't see any major errors, Once tests run clean should be fine to merge

@@ -176,8 +176,13 @@ function civicrm_api3_create_success($values = 1, $params = array(), $entity = N
$values[$key]['id'] = $item[$lowercase_entity . "_id"];
}
if (!empty($item['financial_type_id'])) {
//4.3 legacy handling
$values[$key]['contribution_type_id'] = $item['financial_type_id'];
// 4.3 legacy handling - translate financial_type to contribution_type unless financial_type is explicitly specified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colemanw this change is what is breacking one of the syntaxConformanceTests specifically the grant one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my theory is that it is expecting that contribution_type_id should be outputted in the api array and always matches that of the financial_type_id

@colemanw colemanw changed the title (WIP) CRM-17867 - Api4 core patches CRM-17867 - Api4 core patches Oct 11, 2016
@eileenmcnaughton
Copy link
Contributor

Adding merge on pass per assessment by @seamuslee001 - yay

@eileenmcnaughton eileenmcnaughton added merge on pass and removed needs-work-not-review-ready Submitter required to take action, will be closed after 1-2 weeks in this state labels Oct 11, 2016
@seamuslee001
Copy link
Contributor

@eileenmcnaughton we got a pass

@eileenmcnaughton eileenmcnaughton merged commit e10c60e into civicrm:master Oct 11, 2016
@eileenmcnaughton
Copy link
Contributor

!!

@eileenmcnaughton eileenmcnaughton deleted the api4 branch October 11, 2016 21:57
colemanw added a commit to civicrm/org.civicrm.api4 that referenced this pull request Oct 11, 2016
Core patches have been merged civicrm/civicrm-core#7725
davialexandre added a commit to compucorp/civihr that referenced this pull request Apr 18, 2017
On civicrm/civicrm-core#7725, a lot of changes to
support APIv4 were introduced, including changes to the SelectQuery class,
which now is abstract and cannot be instantiated.

To fix this, the *Select classes now use the Api3SelectQuery class instead.
davialexandre added a commit to compucorp/civihr that referenced this pull request Apr 18, 2017
On civicrm/civicrm-core#7725, a lot of changes to
support APIv4 were introduced, including changes to the SelectQuery class,
which now is abstract and cannot be instantiated.

To fix this, the *Select classes now use the Api3SelectQuery class instead.
davialexandre added a commit to compucorp/civihr that referenced this pull request May 2, 2017
On civicrm/civicrm-core#7725, a lot of changes to
support APIv4 were introduced, including changes to the SelectQuery class,
which now is abstract and cannot be instantiated.

To fix this, the *Select classes now use the Api3SelectQuery class instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants