-
-
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
CRM-19064 Added an API for Personal Campaign Page #7878
Conversation
Can one of the admins verify this patch? |
jenkins, ok to test |
@totten is there any issue with this PR, been update 5 days since checks commenced. |
test this please |
@digitlimit Thanks for sending a patch! Do you have a JIRA issue for this pull-request? (c.f. https://wiki.civicrm.org/confluence/display/CRMDOC/Contributing+to+CiviCRM+using+GitHub step 8 : create a JIRA issue on https://issues.civicrm.org). Also I was wondering why you used "p_c_p" in the function name, instead of "pcp"? Does the API call need documentation/tests? |
@mlutfy thanks for your response. I followed the naming convention of other APIs.
This is because this line However, the correct class name is returned when I name the api method like so :
Please if my explanation is not clear enough I can explain further. I have created a JIRA issue for this PR here: |
ok to test |
Oddly enough AllCoreTables handles IM OK - but not PCP - I wonder why |
Fixed the following warnings 1 - EndFileNewline 1 - LineEndings 3 - ScopeIndent
@eileenmcnaughton Please can you explain what you mean here?
|
Fixed four warnings
I mean that the IM class suffers from the same oddness as PCP - ie. it's all caps rather than camel case - so I thought that whatever meant the im api isn't oddly named would work for pcp too.... Unless people have only actually tested 'Im' not 'IM' in their api calls. |
@eileenmcnaughton The IM (and ACL) APIs have a special exception in api/v3/util.php. I wrote this PCP API a while ago, but I also hacked util.php to keep the name consistent: http://civicrm.stackexchange.com/questions/3030/incoporating-pcps-in-wordpress/3037#3037 |
Jenkin, test this please |
Please fix the style error as per https://test.civicrm.org/job/CiviCRM-Core-PR/8497/checkstyleResult/new/ |
jenkins, retest this please |
1 similar comment
jenkins, retest this please |
// FIXME: DAO names should follow CamelCase convention By changing this: if ($name == 'Im' || $name == 'Acl') { $name = strtoupper($name); } To: if ($name == 'Im' || $name == 'Acl' || $name == 'Pcp') { $name = strtoupper($name); }
Changed p_c_p to pcp which is the right naming convention
The current round of test failures look legit - syntax conformance tests are falling over on the Pcp entity. |
@colemanw please where can view the syntax errors so I can correct them |
These are not syntax errors they are test failures. Click the "details" link below (next to "Merged build finished") to see them. |
// FIXME: DAO names should follow CamelCase convention //Reverted: if ($name == 'Im' || $name == 'Acl' || $name == 'Pcp') { $name = strtoupper($name); } To: if ($name == 'Im' || $name == 'Acl') { $name = strtoupper($name); }
Reverted the naming convention form pcp to p_c_p due to tests failures
OK, I've reviewed the code.
This causes _civicrm_api_get_entity_name_from_camel in api/api.php to return the incorrect name. There's a precedent for writing an exception into that function (for entities with "U_F" in their name) so I wrote one here. This gets us from 10 tests failing to 1. I'll submit an update when I've got that test passing. |
@PalanteJon I would like to work on this with you. |
@digitlimit Great! I've reverted your reversion - "p_c_p" as the entity name will only make the testing suite angrier 😄 When I ran some of the tests manually through the API Explorer (e.g. making a "Get" request with no parameters) I could reload the page and get one or both of these errors:
Note that this was AFTER I reverted the field name. To fix that, I also added this code (below): diff --git a/api/api.php b/api/api.php
index e20c451..a7aafad 100644
--- a/api/api.php
+++ b/api/api.php
@@ -180,6 +180,11 @@ function _civicrm_api_get_entity_name_from_camel($entity) {
if (!$entity || $entity === strtolower($entity)) {
return $entity;
}
+ // Handle PCP as a special case:
+ // https://github.com/civicrm/civicrm-core/pull/7878#issuecomment-219061074
+ else if ($entity == 'PCP') {
+ return 'pcp';
+ }
else {
$entity = ltrim(strtolower(str_replace('U_F',
'uf', Now we're down to one error:
Do you have civicrm-buildkit installed? If so, you can run the unit tests on your own. This will let you know if a change you made fixed itself. Meanwhile, I opened up the file at /tests/phpunit/api/v3/SyntaxConformanceTest.php and looked at the test. It's a long test! If you want to debug and see what's going on, this page will help: https://wiki.civicrm.org/confluence/display/CRMDOC/Testing |
Heh Frank, as Release Manager this month, I'm trying to recruit people to help pare down the backlog of almost 100 PRs, some going back to last summer. I'm wondering if you would be able to help QA another PR if I got someone to QA this PR? |
Yes I do love to, dough I have been so much occupied lately due to office pressure but I am sure I can squeeze out some time. On Jun 13, 2016, 5:12 PM, at 5:12 PM, Joe Murray notifications@github.com wrote:
|
@darrick would you be interested in reviewing this PR, as it combines your API and contribute interests? |
@digitlimit we need a JIRA issue that explains the intent of this PR - could you make one? Thanks, Joe |
@JoeMurray @darrick I've got this PR in my queue, actually. Sorry if |
Thanks, @PalanteJon - I've updated the Google Release doc with Issue # and assigned to you. |
test this please |
… fn. This add function is really wierd & blocking writing an api for pcp - this will get past issues in civicrm#7878
Check the PR I just added (#8697) - that resolves your blocker issue. (NB if someone can QA that PR then it can be merged in advance of this one being completed) |
… fn. This add function is really wierd & blocking writing an api for pcp - this will get past issues in civicrm#7878
I'd like to have an API for Personal Campaign Pages and am willing to help getting this merged. I tried checking why the build failed on Jenkins but the link is broken? Regarding the required changes - I saw this answer on stackexchange and it works for me when I tested it. |
Jenkins re test this please |
@mickadoo Unfortunately that post was by me. It "works for me" too - but it definitely fails on some tests it shouldn't. The good news is that we're past the point outlined by that answer. |
I think it passes if you merge first the patch in #8697) |
… fn. This add function is really wierd & blocking writing an api for pcp - this will get past issues in civicrm#7878
… fn. This add function is really wierd & blocking writing an api for pcp - this will get past issues in civicrm#7878
jenkins, retest this please |
@litespeedmarc @colemanw there has already been a PR that has accomplished this #9049 |
This is great then. I've went ahead & closed the JIRA. Can anyone close the PR? |
Closed in favor of #9049 |
Can one of the admins verify this patch? |
This API exposes CiviCRM Personal Campaign Page (PCP).