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

Pcp api #9012

Closed
wants to merge 71 commits into from
Closed

Pcp api #9012

wants to merge 71 commits into from

Conversation

alar77
Copy link
Contributor

@alar77 alar77 commented Sep 12, 2016

This minimal api for Personal Campaign Pages only implements get.
I noticed that the standard create for PCP attempt to create a record in civicrm_pcp_block. Understanding why in order to be able to change this behaviour is beyond the scope of this project

jitendrapurohit and others added 27 commits August 30, 2016 16:22
----------------------------------------
* CRM-19123: Merging contacts: blank date fields write as 1970
  https://issues.civicrm.org/jira/browse/CRM-19123
Now you can peek, this query is looking for PCP in database, and showing all tables of civicrm_pcp and civicrm_pcp_block, this include their "ID", it can be fail because depend the configuration of database server the result, i mean, the server will select between pcp_block's(table) ID or pcp's(table) ID(In my case, my database server, selected the block ID instead of PCP ID), it's bad because pcp(table) and pcp_block(table) they has the same ID field name, but, it's good structure schema in database, the problem is the query, and can be solve.
Fix up upgrade script and add a system check

rerun regen after rebasing

WIP on adding data type for option group

Further work on soft fail when option value value field doesn't match given data type
…type also minor code changes as suggested on PR
…rom the check when saving the option value form and re run regen.sh
@civicrm-builder
Copy link

Can one of the admins verify this patch?

totten and others added 6 commits September 14, 2016 15:06
(NFC) CRM-19270 Fix contact page ajax test as no array_column in php5.3
CRM-17789 - CRM_Custom_Form_Group - Simplify reltype list
(NFC) CRM-19323: Advanced search relationship date clause description…
(NFC) Fix post upgrade message for 4.7.11
@alar77
Copy link
Contributor Author

alar77 commented Sep 15, 2016

Checked.
It basically works but I had to change class CRM_PCP_DAO_PCP &fields function, too.

The change is actually minimal:

// line 171
// from
'pcp_id' => array(
//to
'p_c_p_id' => array(
but this class is automatically generated, so I suppose the generator is to be patched in ordered to cope to the non standard "PCP" name.
I dont think I have the time to check and understand the whole code generation thing, so.. who could do that?

@eileenmcnaughton
Copy link
Contributor

hmm - that issue is specific to the new api rather than the #8697 patch in general? I feel like that issue got solved in one of the other PRs at one point

@eileenmcnaughton
Copy link
Contributor

I think the answer is on #7878 - a fix / hack at the api layer allows the fn to be pcp_get instead of p_c_p_get ...http://civicrm.stackexchange.com/questions/3030/incoporating-pcps-in-wordpress/3037#3037 -

@alar77
Copy link
Contributor Author

alar77 commented Sep 15, 2016

The issue is that an error is raised in civicrm/api/v3/Generic.php line 111 (civicrm_api3_generic_getfields) when it validates fields.
Changing the api name is not the solution (i attempted id), because the hunt for p_c_p_id when field validation happens is due to the odd name of the table.
#7878 (if I understand it) merely allow calling function civicrm_api3_pcp__ instead of civicrm_api3_p_c_p__ and still finding the correct BAO/DAO classes, but this could also be done explicitly passing the correct name instead of using _civicrm_api3_get_BAO(FUNCTION)

@eileenmcnaughton
Copy link
Contributor

Did you look at that thread from the comment thread on there...

"There's some odd line of hyphens at the bottom, leave that off! Next, in civicrm/api/v3/util.php, you should see a part that looks like:

// FIXME: DAO names should follow CamelCase convention
if ($name == 'Im' || $name == 'Acl') {
$name = strtoupper($name);
}
Change that "if" statement to:

if ($name == 'Im' || $name == 'Acl' || $name == 'Pcp') {"

eileenmcnaughton and others added 2 commits September 15, 2016 21:13
… fn.

This add function is really wierd & blocking writing an api for pcp - this will get past issues in civicrm#7878
@seamuslee001
Copy link
Contributor

@ggargani @eileenmcnaughton I have fixed the field issue it was found by Jon but never committed I have pushed fixes to Eileen's PR and made a PR for a pcp api that is more complete IMO #9045

@alar77
Copy link
Contributor Author

alar77 commented Sep 15, 2016

I dont see unit test in your commit. I removed the create and delete from my implementation because without PR #8697 (allow create api to actually creare a pcp row instead a pcp_block one) and a fix for the undefined index error due to the field validation routines(civicrm_api3_generic_getfields,_civicrm_api3_build_fields_array for example), looking for p_c_p_id as unique name (instead of pcp_id as defined in DAO), we cant successfully run the create test.
The solution is probably around AllCoreTables

@seamuslee001
Copy link
Contributor

@ggargani I have updated #8697 I have fixed it by changing api/api.php and api/v3/utils.php to conform

I ran the syntax conformance tests which auto included my version of the PCP api and they all passed with my amendment to Eileen's PR. Once Eileen's PR.

CRM-18191 CRM-19064 refactor bizareness from PCP create to enable api…
@eileenmcnaughton
Copy link
Contributor

Hi,

This PR is getting blocked before the unit tests actually start - on a style issue - see

https://test.civicrm.org/job/CiviCRM-Core-PR/11616/checkstyleResult/new/

There are some tests in the SyntaxConformanceTest class that will provide some coverage although it is MUCH preferred to have a specific unit test as well

Yashodha Chaku and others added 5 commits September 15, 2016 18:46
CRM-19354 fix fatal on pdf generation if no trxn_id exists
…can't be reached, ERR_INVALID_RESPONSE, File not Found
CRM-19339: Can't create invoice PDF in Chrome and Firefox, This site …
Adds the 3 basic  methods: create, get, delete
Tests included
@alar77
Copy link
Contributor Author

alar77 commented Sep 15, 2016

Messed something with rebase, will resubmit a clean pull request

@alar77 alar77 closed this Sep 15, 2016
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@alar77 alar77 deleted the PCPApi branch September 15, 2016 20:46
@alar77
Copy link
Contributor Author

alar77 commented Sep 15, 2016

Resubmitted a cleaner patch built against the last master: #9045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.