Skip to content

Instantly share code, notes, and snippets.

@pvhee
pvhee / starter.make
Created September 26, 2011 14:10 — forked from brockboland/starter.make
Basic Drush Make starter file
; Basic Drush Make file
; See the Drush Make prject page for info:
; http://drupal.org/project/drush_make
; This file by Brock Boland [brock@brockboland.com]
;
; This file is also on GitHub:
; http://gist.github.com/404528
; Core version
; ------------
@pvhee
pvhee / drupal7.make
Last active September 27, 2015 08:38
Drupal 7 Make file
; Basic Drush Make file
;
; Usage:
; drush make --prepare-install drupal7.make
; Core version
; ------------
; Each makefile should begin by declaring the core version of Drupal that all
; projects should be compatible with.
@pvhee
pvhee / issue1315796-6-cart-remove-product-redirect
Created December 8, 2012 11:26
Patching commerce to fix redirects after removing product from the cart. See http://drupal.org/node/1315796
diff --git a/modules/cart/commerce_cart.module b/modules/cart/commerce_cart.module
index 4d0540d..e500077 100644
--- a/modules/cart/commerce_cart.module
+++ b/modules/cart/commerce_cart.module
@@ -505,7 +505,7 @@ function commerce_cart_block_view($delta) {
// Build the variables array to send to the cart block template.
$variables = array(
'order' => $order,
- 'contents_view' => commerce_embed_view('commerce_cart_block', 'defaults', array($order->order_id)),
+ 'contents_view' => commerce_embed_view('commerce_cart_block', 'defaults', array($order->order_id), $_GET['q'] ),
@pvhee
pvhee / README.md
Last active December 16, 2015 12:18
FP7 projects

A chloropleth map of all the FP7 projects, showing countries leading and partnering in FP7 projects.

Credits

diff --git a/media.module b/media.module
index ade1169..406d1b0 100644
--- a/media.module
+++ b/media.module
@@ -1074,10 +1074,14 @@ function media_file_displays_alter(&$displays, $file, $view_mode) {
*/
function media_file_default_displays_alter(&$file_displays) {
// Image previews should be displayed using the media image style.
- $file_displays['image__preview__file_field_image']->settings['image_style'] = 'media_thumbnail';
+ if (isset($file_displays['image__preview__file_field_image'])) {
@pvhee
pvhee / gist:7307987
Created November 4, 2013 19:35
Libraries patch to include scanning of Foundation base profile libraries
diff --git a/libraries.module b/libraries.module
index 687fa29..782792b 100644
--- a/libraries.module
+++ b/libraries.module
@@ -82,6 +82,9 @@ function libraries_get_libraries() {
// Always search sites/all/libraries.
$searchdir[] = 'sites/all/libraries';
+ // Patch until we sort out https://drupal.org/node/1811486 and drupal_get_profiles actually exists. Profile inheritance is still relatively new, but we need this new, hence the hardcoded hack. Expected to be removed in the next cycle of D7
+ $searchdir[] = drupal_get_path('profile', 'foundation') . "/libraries";
@pvhee
pvhee / output_data_variables_with_vardump.patch
Created November 5, 2013 20:58
Extend Scald data views supports to display arrays for nested values
diff --git a/includes/scald_views_handler_field_data.inc b/includes/scald_views_handler_field_data.inc
index 936f700..583ff42 100644
--- a/includes/scald_views_handler_field_data.inc
+++ b/includes/scald_views_handler_field_data.inc
@@ -44,7 +44,13 @@ class scald_views_handler_field_data extends views_handler_field {
$data = unserialize($values->{$this->field_alias});
$content = NULL;
if (!empty($data[$this->options['data_key']])) {
- $output = (string) $data[$this->options['data_key']];
+
@pvhee
pvhee / gist:8371637
Created January 11, 2014 14:37
Libraries patch to include scanning of Marzee Labs base profile libraries (mz)
diff --git a/libraries.module b/libraries.module
index 687fa29..782792b 100644
--- a/libraries.module
+++ b/libraries.module
@@ -82,6 +82,9 @@ function libraries_get_libraries() {
// Always search sites/all/libraries.
$searchdir[] = 'sites/all/libraries';
+ // Patch until we sort out https://drupal.org/node/1811486 and drupal_get_profiles actually exists. Profile inheritance is still relatively new, but we need this new, hence the hardcoded hack. Expected to be removed in the next cycle of D7
+ $searchdir[] = drupal_get_path('profile', 'mz') . "/libraries";
diff --git a/file_entity.module b/file_entity.module
index da2914f..aa78641 100644
--- a/file_entity.module
+++ b/file_entity.module
@@ -2152,59 +2152,6 @@ function file_entity_upload_validators_pre_render($element) {
}
/**
- * Implements hook_file_default_displays_alter() on behalf of image.module.
- */
@pvhee
pvhee / imagecache_external_utf8
Last active August 29, 2015 14:02
imagecache_external_utf8
diff --git a/imagecache_external.module b/imagecache_external.module
index 124c7b2..9a0682f 100755
--- a/imagecache_external.module
+++ b/imagecache_external.module
@@ -388,6 +388,10 @@ function imagecache_external_allowed_mimetypes() {
'image/png',
'image/gif',
'application/octet-stream',
+ 'image/jpeg;charset=UTF-8',
+ 'image/png;charset=UTF-8',