Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am joemurray on github.
  • I am joemurray (https://keybase.io/joemurray) on keybase.
  • I have a public key whose fingerprint is 1C2D 8E88 EA9E 233D 4B82 10F0 988A 4904 FCE2 D926

To claim this, I am signing this object:

jenkins@test-ubu1204-5:~$ civibuild create pr-9297-1 --type drupal-demo --patch https://github.com/civicrm/civicrm-core/pull/9297
[[Download pr-9297-1 (type 'drupal-demo' in '/home/jenkins/buildkit/build/pr-9297-1')]]
[[Update caches]]
[[Execute /home/jenkins/buildkit/app/config/drupal-demo/download.sh]]
++ source /home/jenkins/buildkit/app/config/drupal-demo/download.sh
+++ '[' -z '' ']'
+++ CMS_VERSION=7.x
+++ '[' -z '' ']'
+++ VOL_VERSION=4.4-1.x
+++ '[' -z '' ']'
@JoeMurray
JoeMurray / PR9948 results.txt
Last active March 10, 2017 16:10
CRM-19966 PR 9948 test results from Pradeep
1. Contribution Receipts
Test Case:
1. Added contribution for $100 using contribution form. Checked Contribution receipt - looks good
2. Updated contribution #1 using contribution form. Checked Contribution receipt - looks good
3. Added contribution for $100 using contribution form with Sales Tax enabled. Checked Contribution receipt - looks good
4. Updated contribution #3 using contribution form with Sales Tax enabled. Checked Contribution receipt - looks good
5. Added contribution using contribution form using priceset having Checkbox, Radio, Text and Select field. Checked Contribution receipt - looks good
6. Updated contribution #5 using contribution form. Checked Contribution receipt - looks good
7. Added contribution using contribution form using priceset having Checkbox, Radio, Text and Select field with Sales Tax enabled. Checked Contribution receipt - looks good. Attached CreateContributionReceipt.png
**8. Updated contribution #7 using contribution form with Sales Tax enabled. Checked Contribution re
@JoeMurray
JoeMurray / gist:12dfc7bd27be6245a3f3cf7d923de7bf
Created July 19, 2017 19:02
Expected one FinancialAccount but found 25
CiviCRM_API3_Exception: "Expected one FinancialAccount but found 25"
#0 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(5834): civicrm_api3("Contribution", "create", (Array:2))
#1 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(237): CRM_Contribute_BAO_Contribution::storeInvoiceNumber(91)
#2 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(512): CRM_Contribute_BAO_Contribution::add((Array:32), (Array:1))
#3 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(2442): CRM_Contribute_BAO_Contribution::create((Array:32), (Array:1))
#4 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Member/BAO/Membership.php(360): CRM_Member_BAO_Membership::recordMembershipContribution((Array:31), (Array:1))
#5 /home/accrual.jmaconsulting.biz/htdocs/sites/all/modules/civicrm/CRM/Member/Form/Membership.php(1675):
Sep 29 14:21:34 [warning] Deprecated function, use CRM_Core_PseudoConstant::getKey
Array
(
[civi.tag] => deprecated
)
Sep 29 14:21:34 [warning] Deprecated function, use CRM_Core_PseudoConstant::getKey
Array
(

Limitations

  1. A contribution cannot have multiple line-items which share same price_field_id and/or price_field_value_id because there is a unique key defined for line-item table which expects unique combination of these attributes
  2. A contribution cannot have multiple line-items linked with price fields of different price-sets, otherwise it will cause a issue while doing 'Record Payment' as I tested on local by relaxing the crieria to allow user to add line-item linked to price fields of different price sets. Add after paying the addtional due amount, leads to incorrect financial entries and Contribution status still kept to 'Partially Paid'.

Proposal

Keeping in mind both the limitations here's what my approach to support add multiple line-items.

New Contribution with quick-config price field

Limitations

  1. A contribution cannot have multiple line-items which share same price_field_id and/or price_field_value_id because there is a unique key defined for line-item table which expects unique combination of these attributes
  2. A contribution cannot have multiple line-items linked with price fields of different price-sets, otherwise it will cause a issue while doing 'Record Payment' as I tested on local by relaxing the crieria to allow user to add line-item linked to price fields of different price sets. Add after paying the additional due amount, this leads to incorrect financial entries and Contribution status still kept to 'Partially Paid'.

Objectives

  1. Avoid polluting user experience with (a large number of) price field or price set entries that the user should not change and doesn't need to know about.
  2. Avoid creating a large number of entries in config tables like price set and price field when
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews
# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>
@JoeMurray
JoeMurray / gist:213287ef08181ac5623b9c93f2306395
Created September 24, 2018 16:52
grant application install error log
CiviCRM_API3_Exception: "DB Error: already exists"
#0 /home/git-civicrm/civicrm-core/CRM/Admin/Form/Extensions.php(190): civicrm_api3("Extension", "install", (Array:2))
#1 /home/git-civicrm/civicrm-core/CRM/Core/Form.php(489): CRM_Admin_Form_Extensions->postProcess()
#2 /home/git-civicrm/civicrm-core/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#3 /home/git-civicrm/civicrm-core/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
#4 /home/git-civicrm/civicrm-core/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
#5 /home/git-civicrm/civicrm-core/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
#6 /home/git-civicrm/civicrm-core/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#7 /home/git-civicrm/civicrm-core/CRM/Core/Page/Basic.php(398): CRM_Core_Controller->run()
@JoeMurray
JoeMurray / gist:0523c11299f764ea8fcef906c7d6128a
Created November 9, 2018 21:31
rh2 output from purge of linux-images
root@rh2:~# dpkg --purge $(dpkg -l|grep linux-image|awk '{print $2}')
(Reading database ... 120681 files and directories currently installed.)
Removing linux-image-4.4.0-101-generic (4.4.0-101.124) ...
Purging configuration files for linux-image-4.4.0-101-generic (4.4.0-101.124) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-101-generic /boot/vmlinuz-4.4.0-101-generic
run-parts: executing /etc/kernel/postrm.d/x-grub-legacy-ec2 4.4.0-101-generic /boot/vmlinuz-4.4.0-101-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-101-generic /boot/vmlinuz-4.4.0-101-generic
Removing linux-image-4.4.0-103-generic (4.4.0-103.126) ...
Purging configuration files for linux-image-4.4.0-103-generic (4.4.0-103.126) ...