Skip to content

Instantly share code, notes, and snippets.

View colepacak's full-sized avatar

Cole Pacak colepacak

View GitHub Profile
@colepacak
colepacak / recursive-promise-test.html
Last active August 29, 2015 14:22
Using recursion to execute jQuery animation promises.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="scripts.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="promise-test">
<button>BOMBS AWAY</button>
<ul>
{
"name": "favish/demo",
"description": "demo",
"type": "project",
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
diff --git a/plugins/views_plugin_query_default.inc b/plugins/views_plugin_query_default.inc
index 8a15e8d..03183ba 100644
--- a/plugins/views_plugin_query_default.inc
+++ b/plugins/views_plugin_query_default.inc
@@ -1195,10 +1195,16 @@ class views_plugin_query_default extends views_plugin_query {
if (!empty($field['function'])) {
$info = $this->get_aggregation_info();
- if (!empty($info[$field['function']]['method']) && function_exists($info[$field['function']]['method'])) {
- $string = $info[$field['function']]['method']($field['function'], $string);
diff --git a/theme/views-data-export-csv-header.tpl.php b/theme/views-data-export-csv-header.tpl.php
index e40a1bf..9fe4424 100644
--- a/theme/views-data-export-csv-header.tpl.php
+++ b/theme/views-data-export-csv-header.tpl.php
@@ -2,5 +2,8 @@
// Print out header row, if option was selected.
if ($options['header']) {
+ // Begin file with UTF-8 BOM.
+ print ("\xEF\xBB\xBF");
@colepacak
colepacak / chosen_ajax_override_theme_textfield.patch
Created September 7, 2016 16:24
Chosen Ajax - Override theme textfield
diff --git a/chosen_ajax.module b/chosen_ajax.module
index 5b2f460..ff7a7d9 100644
--- a/chosen_ajax.module
+++ b/chosen_ajax.module
@@ -146,7 +146,14 @@ function chosen_ajax_theme_registry_alter(&$theme_registry) {
function chosen_ajax_theme_textfield($variables) {
$element = $variables['element'];
if (!isset($element['#chosen_ajax'])) {
- return theme_textfield($variables);
+ if (
diff --git a/modules/commerce_billy_pdf/commerce_billy_pdf.module b/modules/commerce_billy_pdf/commerce_billy_pdf.module
index 8af41b0..abe546d 100644
--- a/modules/commerce_billy_pdf/commerce_billy_pdf.module
+++ b/modules/commerce_billy_pdf/commerce_billy_pdf.module
@@ -200,6 +200,22 @@ function commerce_billy_pdf_commerce_order_view($order, $view_mode) {
$order->content['invoice_logo'] = array(
'#value' => variable_get('commerce_billy_pdf_logo', 'misc/druplicon.png'),
);
+ // Get civicrm contact off of membership line item
+ $line_items = $order->commerce_line_items;
@colepacak
colepacak / commerce_billy_pdf_add_order_status_checkout_checkout.patch
Created September 7, 2016 16:32
Add order status of checkout_checkout
diff --git a/modules/commerce_billy_pdf/commerce_billy_pdf.module b/modules/commerce_billy_pdf/commerce_billy_pdf.module
index bb9a13d..8af41b0 100644
--- a/modules/commerce_billy_pdf/commerce_billy_pdf.module
+++ b/modules/commerce_billy_pdf/commerce_billy_pdf.module
@@ -49,7 +49,7 @@ function commerce_billy_pdf_view_access($order) {
if ($order->status == 'canceled' && user_access('administer commerce_order entities')) {
return TRUE;
}
- elseif ($order->status != 'invoiced') {
+ elseif ($order->status != 'invoiced' && $order->status != 'checkout_checkout') {
@colepacak
colepacak / google_recaptcha_add_custom_form.patch
Created September 7, 2016 16:37
Google Recaptcha - Add custom form
diff --git a/google_recaptcha.admin.inc b/google_recaptcha.admin.inc
index 04e8545..cf0952e 100644
--- a/google_recaptcha.admin.inc
+++ b/google_recaptcha.admin.inc
@@ -205,6 +205,9 @@ function g_forms($form, &$form_state) {
}
}
}
+ if (module_exists('aact_membership_process')) {
+ $available_forms['aact_membership_process_join_register_form'] = t('AACT Membership Process - User Registration');
@colepacak
colepacak / redirect_on_user_register_submit.patch
Last active September 7, 2016 16:48
User - Redirect on user_register_submit
diff --git a/modules/user/user.module b/modules/user/user.module
index b239799..acb57b6 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -3877,16 +3877,17 @@ function user_register_submit($form, &$form_state) {
// New administrative account without notification.
$uri = entity_uri('user', $account);
+
if ($admin && !$notify) {
@colepacak
colepacak / chosen_ajax_check_if_chosen_is_enabled-7.x-1.0-beta1.patch
Last active September 26, 2016 20:21
Chosen Ajax - Check if chosen is enabled
diff --git a/chosen_ajax.module b/chosen_ajax.module
index 5b2f460..c0cf4ba 100644
--- a/chosen_ajax.module
+++ b/chosen_ajax.module
@@ -109,7 +109,7 @@ function chosen_ajax_field_widget_form_alter(&$element, &$form_state, $context)
* Helper function to update element recursively.
*/
function chosen_ajax_field_widget_apply_recursive(&$element, $settings) {
- if (isset($element['#chosen'])) {
+ if (!empty($element['#chosen']) && $element['#chosen']) {