Skip to content

Instantly share code, notes, and snippets.

@pvhee
pvhee / PLAT-235_paragraph_constraint_violation.patch
Created May 18, 2016 14:04
PLAT-235_paragraph_constraint_violation.patch
diff --git a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
index b1fee2a..5f954c3 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
@@ -16,7 +16,7 @@ class EntityChangedConstraintValidator extends ConstraintValidator {
public function validate($entity, Constraint $constraint) {
if (isset($entity)) {
/** @var \Drupal\Core\Entity\EntityInterface $entity */
- if (!$entity->isNew()) {
+ if (!$entity->isNew() && $entity->getEntityTypeId() != 'paragraph') {
Sat May 14 17:59:30 UTC 2016
@pvhee
pvhee / message_broker_php_amqplib_change.patch
Last active March 13, 2016 09:41
message_broker_php_amqplib_change.patch
diff --git a/modules/message_broker_amqp/message_broker_amqp.install b/modules/message_broker_amqp/message_broker_amqp.install
index 3175c6a..4975a92 100644
--- a/modules/message_broker_amqp/message_broker_amqp.install
+++ b/modules/message_broker_amqp/message_broker_amqp.install
@@ -30,9 +30,9 @@ function message_broker_amqp_uninstall() {
function _message_broker_amqp_library_exists() {
if (function_exists('libraries_get_libraries')) {
$installed_libraries = libraries_get_libraries();
- $lib_path = libraries_get_path('phpamqp') . DIRECTORY_SEPARATOR . 'PhpAmqpLib';
+ $lib_path = libraries_get_path('php-amqplib') . DIRECTORY_SEPARATOR . 'PhpAmqpLib';
@pvhee
pvhee / gist:6f4a6f9dd53ddcd01cb5
Created February 21, 2016 23:44
Hard-code to use googlemaps geocoder
diff --git a/modules/geocoder_geofield/geocoder_geofield.module b/modules/geocoder_geofield/geocoder_geofield.module
index 9dd9fab..ab059e4 100644
--- a/modules/geocoder_geofield/geocoder_geofield.module
+++ b/modules/geocoder_geofield/geocoder_geofield.module
@@ -23,6 +23,8 @@ function geocoder_geofield_entity_presave(\Drupal\Core\Entity\EntityInterface $e
}, ARRAY_FILTER_USE_BOTH)
);
+ $settings['provider_plugins'] = array('googlemaps');
+
@pvhee
pvhee / gist:72637f2561526ed73abe
Created February 19, 2016 17:32
ctools_block patch
diff --git a/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php b/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php
index 749aae0..76e7b63 100644
--- a/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php
+++ b/modules/ctools_block/src/Plugin/Deriver/EntityFieldDeriver.php
@@ -24,6 +24,7 @@ public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityManager->getFieldStorageDefinitions($entity_type_id) as $field_definition) {
$field_name = $field_definition->getName();
$field_info = $entity_field_map[$field_name];
+
$derivative_id = $entity_type_id . ":" . $field_name;
@pvhee
pvhee / menu_alter_callback-1079628-3.patch
Created October 22, 2015 10:33
menu_alter_callback-1079628-3.patch
diff --git a/includes/menu.inc b/includes/menu.inc
index 5582c45..43b22ce 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -2689,11 +2689,16 @@ function _menu_link_build($item) {
function _menu_navigation_links_rebuild($menu) {
// Add normal and suggested items as links.
$menu_links = array();
+ $menu_drop = array();
foreach ($menu as $path => $item) {
@pvhee
pvhee / is_writable_stream_wrapper_nfs_fix.patch
Last active October 22, 2015 10:48
is_writable_stream_wrapper_nfs_fix.patch
diff --git a/includes/file.inc b/includes/file.inc
index d3ac87e..81459fa 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -443,7 +443,7 @@ function file_prepare_directory(&$directory, $options = FILE_MODIFY_PERMISSIONS)
return FALSE;
}
// The directory exists, so check to see if it is writable.
- $writable = is_writable($directory);
+ $writable = is_writable(drupal_realpath($directory));
@pvhee
pvhee / ds_patch_search.patch
Created June 11, 2015 14:17
ds_patch_search.patch
diff --git a/modules/ds_search/ds_search.module b/modules/ds_search/ds_search.module
index fdabe5a..7eb1731 100644
--- a/modules/ds_search/ds_search.module
+++ b/modules/ds_search/ds_search.module
@@ -294,6 +294,10 @@ function ds_search_search_page($results) {
$key = '#term';
break;
+ case 'profile2':
+ $key = '#entity';
@pvhee
pvhee / ds_search_core_search_isbe.patch
Created June 11, 2015 14:15
ds_search_core_search_isbe.patch
diff --git a/modules/ds_search/ds_search.module b/modules/ds_search/ds_search.module
index 7eb1731..f58e6a0 100644
--- a/modules/ds_search/ds_search.module
+++ b/modules/ds_search/ds_search.module
@@ -760,7 +760,7 @@ function ds_search_process_results($results) {
* Implements hook_apachesolr_search_page_alter(&$build, $search_page).
*/
function ds_search_apachesolr_search_page_alter(&$build, $search_page) {
- if (!empty($build['search_results']['#results'])) {
+ if ($search_page['page_id'] == 'core_search' && !empty($build['search_results']['#results'])) {