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

(NFC) Add unit test of submitting the Pledge Search Form #12085

Merged
merged 1 commit into from
May 11, 2018

Conversation

seamuslee001
Copy link
Contributor

Overview

This adds a unit test to show failure of pledge search form on systems with ONLY_FULL_GROUP_BY enabled

Before

No Test

After

Test to ensure search form functions

ping @eileenmcnaughton @monishdeb

@seamuslee001 seamuslee001 force-pushed the pledge_search_form_test branch 6 times, most recently from 532adb9 to 1ee3d59 Compare May 7, 2018 05:41
@monishdeb
Copy link
Member

@seamuslee001 on top of the patch I am still getting the error on FGB enabled setup:
test-multiple-after

DB error:

 [code] => -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => SELECT GROUP_CONCAT(DISTINCT contact_a.id) as contact_id, GROUP_CONCAT(DISTINCT contact_a.contact_type) as `contact_type`, GROUP_CONCAT(DISTINCT contact_a.contact_sub_type) as `contact_sub_type`, GROUP_CONCAT(DISTINCT contact_a.sort_name) as `sort_name`, GROUP_CONCAT(DISTINCT contact_a.display_name) as `display_name`, civicrm_pledge.id as pledge_id, GROUP_CONCAT(DISTINCT civicrm_pledge.amount) as pledge_amount, GROUP_CONCAT(DISTINCT civicrm_pledge.create_date) as pledge_create_date, GROUP_CONCAT(DISTINCT civicrm_pledge.start_date) as pledge_start_date, GROUP_CONCAT(DISTINCT pledge_status.value) as pledge_status_id, GROUP_CONCAT(DISTINCT pledge_status.label) as pledge_status,  (SELECT sum(civicrm_pledge_payment.actual_amount) FROM civicrm_pledge_payment WHERE civicrm_pledge_payment.pledge_id = civicrm_pledge.id AND civicrm_pledge_payment.status_id = 1 ) as pledge_total_paid, GROUP_CONCAT(DISTINCT  (SELECT civicrm_pledge_payment.scheduled_date FROM civicrm_pledge_payment WHERE civicrm_pledge_payment.pledge_id = civicrm_pledge.id AND civicrm_pledge_payment.status_id IN (2,6) ORDER BY civicrm_pledge_payment.scheduled_date ASC LIMIT 0, 1)) as pledge_next_pay_date, GROUP_CONCAT(DISTINCT  (SELECT civicrm_pledge_payment.scheduled_amount FROM civicrm_pledge_payment WHERE civicrm_pledge_payment.pledge_id = civicrm_pledge.id AND civicrm_pledge_payment.status_id IN (2,6) ORDER BY civicrm_pledge_payment.scheduled_date ASC LIMIT 0, 1)) as pledge_next_pay_amount,  (SELECT sum(civicrm_pledge_payment.scheduled_amount) FROM civicrm_pledge_payment WHERE civicrm_pledge_payment.pledge_id = civicrm_pledge.id AND civicrm_pledge_payment.status_id = 6 ) as pledge_outstanding_amount, GROUP_CONCAT(DISTINCT (SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id)) as pledge_financial_type, GROUP_CONCAT(DISTINCT civicrm_pledge.contribution_page_id) as pledge_contribution_page_id, GROUP_CONCAT(DISTINCT civicrm_pledge.frequency_interval) as pledge_frequency_interval, GROUP_CONCAT(DISTINCT civicrm_pledge.frequency_unit) as pledge_frequency_unit, GROUP_CONCAT(DISTINCT civicrm_pledge.is_test) as pledge_is_test, GROUP_CONCAT(DISTINCT civicrm_pledge.campaign_id) as pledge_campaign_id, GROUP_CONCAT(DISTINCT civicrm_pledge.currency) as pledge_currency   FROM civicrm_contact contact_a LEFT JOIN civicrm_pledge  ON civicrm_pledge.contact_id = contact_a.id  LEFT JOIN civicrm_option_group option_group_pledge_status ON (option_group_pledge_status.name = 'pledge_status') LEFT JOIN civicrm_option_value pledge_status ON (civicrm_pledge.status_id = pledge_status.value AND option_group_pledge_status.id = pledge_status.option_group_id )  WHERE  ( civicrm_pledge.is_test = 0 )  AND (contact_a.is_deleted = 0)   GROUP BY civicrm_pledge.id,  pledge_create_date desc,  contact_a.id  ORDER BY `pledge_create_date` desc, `contact_a`.`id`  LIMIT 0, 50  [nativecode=1056 ** Can't group on 'pledge_create_date']

Is there any other PR linked to it?

@seamuslee001
Copy link
Contributor Author

@monishdeb no i was putting this in to prove the problem

@monishdeb
Copy link
Member

oh ok

@monishdeb
Copy link
Member

monishdeb commented May 7, 2018

@seamuslee001 well what you know, applying the patch #11996 fix this issue too, here's the screencast:
test-multiple-after

@eileenmcnaughton so the PR 11996 now fix two FGB regression + we got UT now.

@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

2 similar comments
@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@monishdeb
Copy link
Member

@seamuslee001 kudos it passed all test. Should I merge it?

@seamuslee001
Copy link
Contributor Author

I don't see why not

@monishdeb monishdeb merged commit e8b76a7 into civicrm:master May 11, 2018
@monishdeb monishdeb deleted the pledge_search_form_test branch May 11, 2018 04:12
@monishdeb
Copy link
Member

Done 👍 Thanks!

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.

3 participants