Skip to content

Instantly share code, notes, and snippets.

diff --git a/includes/ScaldAtomController.inc b/includes/ScaldAtomController.inc
index 3402499..cd1f898 100644
--- a/includes/ScaldAtomController.inc
+++ b/includes/ScaldAtomController.inc
@@ -181,12 +181,23 @@ class ScaldAtomController extends DrupalDefaultEntityController {
if (!isset($atom->data)) {
$atom->data = array();
}
+ if (!isset($atom->created)) {
+ $atom->created = REQUEST_TIME;
@pvhee
pvhee / 0_reuse_code.js
Created July 17, 2014 17:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pvhee
pvhee / field_collection_migrate_language.patch
Created July 15, 2014 08:52
field_collection_migrate_language.patch
diff --git a/field_collection/field_collection.migrate.inc b/field_collection/field_collection.migrate.inc
index 552551b..27e9165 100644
--- a/field_collection/field_collection.migrate.inc
+++ b/field_collection/field_collection.migrate.inc
@@ -105,7 +105,7 @@ class MigrateDestinationFieldCollection extends MigrateDestinationEntity {
$updating = FALSE;
$host_entity = entity_load_single($this->hostEntityType, $collection->host_entity_id);
entity_get_controller($this->hostEntityType)->resetCache();
- $entity->setHostEntity($this->hostEntityType, $host_entity);
+ $entity->setHostEntity($this->hostEntityType, $host_entity, $collection->language);
@pvhee
pvhee / gist:9f154eeb68966fa7c59f
Last active August 29, 2015 14:02
Hard-coding timeline JS version
diff --git a/views_timelinejs.module b/views_timelinejs.module
index f1a1a4d..f9b0989 100644
--- a/views_timelinejs.module
+++ b/views_timelinejs.module
@@ -40,17 +40,13 @@ function views_timelinejs_libraries_info() {
'name' => 'timeline',
'vendor url' => 'http://timeline.verite.co',
'download url' => 'http://timeline.verite.co',
- 'version arguments' => array(
- 'file' => 'build/js/timeline.js',
@pvhee
pvhee / sharethis.patch
Created June 16, 2014 08:36
sharethis.patch
diff --git a/sharethis.module b/sharethis.module
index b11b052..5b8b988 100644
--- a/sharethis.module
+++ b/sharethis.module
@@ -304,15 +304,15 @@ function sharethis_node_view($node, $view_mode, $langcode) {
}
// This will choose the path to use.
if ($is_path) {
- $path_module = $node->path;
+ $path_module = url($node->path['source']);
diff --git a/plugins/export_ui/semantic_fields_ctools_export_ui.inc b/plugins/export_ui/semantic_fields_ctools_export_ui.inc
index 3c31148..274c82e 100644
--- a/plugins/export_ui/semantic_fields_ctools_export_ui.inc
+++ b/plugins/export_ui/semantic_fields_ctools_export_ui.inc
@@ -325,15 +325,12 @@ function semantic_fields_ctools_export_ui_form(&$form, &$form_state) {
);
if (module_exists('token') == TRUE) {
$form['semantic_field_settings']['tokens_fieldset']['info'] = array(
- '#markup' => t('You could use tokens, like <em>[node:title]</em> and <em>[node:url]</em> !token_tree', array(
- '!token_tree' => theme(
@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',
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 / 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";
@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']];
+