Skip to content

Instantly share code, notes, and snippets.

$content = array(
'member_id_row' => array(
'#type' => 'container',
'#attributes' => arra(),
'label' => array(
'#markup' => '<label>' . t('Member ID') . '</label>',
),
'value' => array(
'#markup' => '<span>' . $GLOBALS['user']->name . '</span>',
)
@cravecode
cravecode / find-php-reference.md
Created May 19, 2014 22:33
Find '&' incorrectly used as passing a variable by reference instead of it being used as the function's arguments.
^((?!(?:function|\*|\/\/)).)*\(.*?\&\$.*$
7f06b9f0cbe390c71fe7e2697536ad8b5eba03ac
CRM/Contribute/BAO/Contribution.php | 4 ++--
CRM/Contribute/Form/AdditionalInfo.php | 4 ++--
CRM/Contribute/Form/Contribution.php | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php
index d133641..09717c3 100644
--- a/CRM/Contribute/BAO/Contribution.php
+++ b/CRM/Contribute/BAO/Contribution.php
@cravecode
cravecode / civicrm-issue-549.patch
Last active December 28, 2015 01:29
Corrects the issue that causes non-billing primary address from showing in the my account drupal profile fields.
diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php
index e721f2c..25c50c3 100644
--- a/CRM/Core/BAO/UFGroup.php
+++ b/CRM/Core/BAO/UFGroup.php
@@ -2128,6 +2128,16 @@ AND ( entity_id IS NULL OR entity_id <= 0 )
$defaults[$fldName] = $details[$name];
}
}
+ else if($locTypeId == 1 && is_string($value)) {
+ $trimmed_field_name = str_replace('-Primary', '', $fldName);
@cravecode
cravecode / apache_drupal_host
Created August 17, 2011 22:16
Apache Drupal Template Host File
# $Id: dist-apache2.conf,v 1.2 2009/09/16 07:37:27 deniver Exp $
#
# Keywords used by the densite script:
#
# server_name
# document_root
# allow_ip
# site_root
#
<VirtualHost *:80>
@cravecode
cravecode / Drush-7-Install.sh
Created August 3, 2011 17:08
Shell Drush Install Script
#!/bin/bash
# Update user
echo "Drush is now downloading via HTTP"
# move to home dir
cd ~
# remove current drush (if existent)
rm -rf ~/.drush/
# create drush directory (and hide it)