Skip to content

Instantly share code, notes, and snippets.

@tauno
tauno / wpfront-notification-bar_remove-landing-cookie.patch
Created September 1, 2017 18:42
Patch to remove server set cookie from wpfront-notification-bar plugin
@tauno
tauno / ContactMergeTrigger.apxt
Created August 26, 2016 17:02
Simple merge log Trigger for Salesforce Contacts
trigger ContactMergeTrigger on Contact (after delete) {
List<Merged_Contact__c> listMergedContacts = new List<Merged_Contact__c>();
for(Contact contact : trigger.old) {
if(String.isNotBlank(contact.MasterRecordId)) {
listMergedContacts.add(new Merged_Contact__c(Contact__c = contact.MasterRecordId, Old_Contact__c = contact.id));
}
}
if(listMergedContacts.size() > 0) {
insert listMergedContacts;
}
@tauno
tauno / salesforce-escape-external-id.patch
Created December 31, 2013 18:12
Escape external id value in upserts
diff --git a/includes/salesforce.inc b/includes/salesforce.inc
index a329e93..e1bfa33 100644
--- a/includes/salesforce.inc
+++ b/includes/salesforce.inc
@@ -504,6 +504,13 @@ class Salesforce {
if (isset($params[$key])) {
unset($params[$key]);
}
+
+ // External key values with punctuation need to be escaped.
@tauno
tauno / imce_pantheon.patch
Created December 7, 2012 20:08
Patch for Drupal IMCE 1.6 module to make it work better on Pantheon
diff --git a/inc/imce.page.inc b/inc/imce.page.inc
index 5c60d53..1598f8b 100644
--- a/inc/imce.page.inc
+++ b/inc/imce.page.inc
@@ -682,9 +682,19 @@ function imce_validate_quotas($file, &$imce, $add = 0) {
*/
if (variable_get('imce_image_get_info', 0)) {
function imce_image_info($file) {
+ if (function_exists('apc_fetch')) {
+ $cache = apc_fetch($file);
<?php
/**
* Check if the file is an image and return info.
*/
function imce_image_info($file) {
if (function_exists('apc_fetch')) {
$cache = apc_fetch($file);
if ($cache) {
return $cache;
}