Skip to content

Instantly share code, notes, and snippets.

@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";
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 / 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

@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 / 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 / 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
; ------------