Skip to content

Instantly share code, notes, and snippets.

image:
name: composer:1.9.1
package:
before_script:
- composer config -g cache-dir "$(pwd)/.composer-cache"
script:
- composer install --ignore-platform-reqs --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress
- rm -rf .git .gitlab-ci.yml .gitignore
- rm -rf .composer-cache
@sluc23
sluc23 / Mailing.php
Created July 10, 2019 08:58
Add SendGrid X-SMTPAPI Headers
--- CRM/Mailing/BAO/Mailing.php 2019-05-15 20:00:28.000000000 +0200
+++ CRM/Mailing/BAO/Mailing.php.new 2019-07-10 10:56:06.561926552 +0200
@@ -1034,6 +1034,14 @@
if ($isForward) {
$headers['Subject'] = "[Fwd:{$this->subject}]";
}
+
+ // Add SendGrid X-SMTPAPI Headers
+ $json_string = ['category' => $this->name];
+ if ($event_queue_id) {
# boa info
WARN: This system is not supported: unknown / not a virtual machine
Aegir on Debian/stretch x86_64
VPS unknown / not a virtual machine
CPU 8
RAM 15913
XTR _XTRAS_LIST="ADM CSF FTP CGP SR4 SR7"
MFX _MODULES_FIX=YES
--- CRM/Contact/BAO/Query.php 2018-05-14 17:20:43.662954863 +0200
+++ CRM/Contact/BAO/Query.php 2018-05-14 17:51:30.726875417 +0200
@@ -6054,7 +6054,7 @@
}
}
elseif ($value['pseudoField'] == 'state_province_abbreviation') {
- $dao->$key = CRM_Core_PseudoConstant::stateProvinceAbbreviation($val);
+ $dao->$key = CRM_Core_PseudoConstant::stateProvince($val);
}
// @todo handle this in the section above for pseudoconstants.
@sluc23
sluc23 / update
Created February 1, 2019 11:43
Gitlab update hook to rejct tag if extension <version> is different than tag
#!/bin/bash
# Git arguments
refname="$1"
oldrev="$2"
newrev="$3"
log() { printf '%s\n' "$*"; }
error() { log "ERROR: $*" >&2; }
fatal() { error "$*"; exit 1; }
@sluc23
sluc23 / gist:a83cb45c05c784747b4d8b0c16a19af7
Created November 30, 2018 12:31
CiviCRM files using `CRM.buildCustomData()`
./CRM/Member/Form/Membership.php:580: 'onChange' => "buildMaxRelated(this.value,true); CRM.buildCustomData('Membership', this.value);",
./CRM/Member/Form/MembershipRenewal.php:328: $js = array('onChange' => "setPaymentBlock(); CRM.buildCustomData('Membership', this.value);");
./CRM/Contribute/Form/Contribution.php:633: array('onChange' => "CRM.buildCustomData( 'Contribution', this.value );")
./CRM/Campaign/Form/Campaign.php:217: $this->addSelect('campaign_type_id', array('onChange' => "CRM.buildCustomData( 'Campaign', this.value );"), TRUE);
./CRM/Grant/Form/Grant.php:174: $this->addSelect('grant_type_id', array('onChange' => "CRM.buildCustomData( 'Grant', this.value );"), TRUE);
./CRM/Case/Form/Activity/OpenCase.php:161: 'onchange' => "CRM.buildCustomData('Case', this.value);",
./CRM/Activity/Form/Activity.php:669: 'onchange' => "CRM.buildCustomData( 'Activity', this.value );",
./CRM/Event/Form/ManageEvent/EventInfo.php:155: array('onChange' => "CRM.buildCustomData( 'Event
@sluc23
sluc23 / gist:1c6f6f1eccddf06316e514d8e83f5344
Created November 29, 2018 15:03
CRM.buildCustomData(
Searching 5208 files for "CRM.buildCustomData("
/data/work/source/civicrm/civicrm-core/CRM/Activity/Form/Activity.php:
667 array('' => '- ' . ts('select') . ' -') + $this->_fields['followup_activity_type_id']['attributes'],
668 FALSE, array(
669: 'onchange' => "CRM.buildCustomData( 'Activity', this.value );",
670 'class' => 'crm-select2 required',
671 )
/data/work/source/civicrm/civicrm-core/CRM/Campaign/Form/Campaign.php:
@sluc23
sluc23 / gist:4188ae5c1432872b34813376ce727f49
Created April 23, 2018 12:15
CiviCRM patch with is_readable() for BOA perms issue
--- civicrm/CRM/Extension/ClassLoader.php.original 2018-04-23 14:12:36.774673526 +0200
+++ civicrm/CRM/Extension/ClassLoader.php 2018-04-23 14:14:05.838673697 +0200
@@ -82,7 +82,7 @@
}
$file = $this->getCacheFile();
- if (file_exists($file)) {
+ if (is_readable($file)) {
$loader = require $file;
}
@sluc23
sluc23 / gist:cb491aff6fdb3eee224045ead30e40f9
Created February 22, 2018 14:52
CiviCRM 4.7 patch to avoid BOA perms issue
--- CRM/Extension/ClassLoader.php.bkp 2018-02-07 04:59:01.000000000 +0100
+++ CRM/Extension/ClassLoader.php 2018-02-22 15:30:16.242395374 +0100
@@ -82,7 +82,7 @@
}
$file = $this->getCacheFile();
- if (file_exists($file)) {
+ if (file_exists($file) && fileperms($file)) {
$loader = require $file;
}
root@server-dev:~# cat /var/aegir/install.log
'drush' cache was cleared. [success]
Aegir HEAD automated install script
==============================================================================
Some settings have not been provided and will now be prompted.
Don't worry: you will get to review those settings after the final install
This script will operate the following changes in your system:
1. Create server-level configuration directories