Skip to content

Instantly share code, notes, and snippets.

View spotzero's full-sized avatar

David Pascoe-Deslauriers spotzero

View GitHub Profile
@spotzero
spotzero / drupal-images.patch
Last active July 22, 2022 18:14
Force delivery of a image in case of you have a filesystem that doesn't allow chmod
diff --git a/core/modules/image/src/Controller/ImageStyleDownloadController.php b/core/modules/image/src/Controller/ImageStyleDownloadController.php
index c943452b5b..5f1459a64a 100644
--- a/core/modules/image/src/Controller/ImageStyleDownloadController.php
+++ b/core/modules/image/src/Controller/ImageStyleDownloadController.php
@@ -204,23 +204,17 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st
$this->lock->release($lock_name);
}
- if ($success) {
- $image = $this->imageFactory->get($derivative_uri);
@spotzero
spotzero / wxtupdate420-toc.patch
Last active January 14, 2022 21:51
fix for WxT Upgrade where rich_text is unavailable
diff --git a/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php b/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
index 2d086ab..a1b66b8 100644
--- a/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
+++ b/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
@@ -64,25 +64,29 @@ public function enableCKEditorTOC() {
$this->moduleInstaller->install(['toc_filter']);
$format = FilterFormat::load('rich_text');
- $configuration = $format->filters('filter_caption')->getConfiguration();
- $format->setFilterConfig('entity_embed', ['weight' => $configuration['weight'] + 1]);
diff --git a/modules/node/node.module b/modules/node/node.module
index cf41ce7145..ca01feb33f 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -3434,6 +3434,9 @@ function _node_query_node_access_alter($query, $type) {
$subquery = db_select('node_access', 'na')
->fields('na', array('nid'));
+ // New conditional or and and
+ $empty_conditions = db_or();
@spotzero
spotzero / Makefile
Last active April 2, 2024 14:54
Very Simple Podman and Buildah Makefile for Drupal local dev and beyond with Solr support
# Quick and lean Drupal local dev with Podman and an unpriviledged user.
#
# To use, run the following:
# 1. projectname="myproject"
# 2. composer create-project drupal-composer/drupal-project:8.x-dev $projectname --no-interaction
# 3. cd $projectname
# 4. curl -o Makefile https://gist.githubusercontent.com/spotzero/18fd821cb9081c666a629e940f166f52/raw
# 5. make start
# 6. make install
#
diff --git a/entity_translation.admin.inc b/entity_translation.admin.inc
index 3bdf410..66ac4e2 100644
--- a/entity_translation.admin.inc
+++ b/entity_translation.admin.inc
@@ -252,7 +252,7 @@ function entity_translation_overview($entity_type, $entity, $callback = NULL) {
foreach ($languages as $language) {
$classes = array();
$options = array();
- $language_name = $language->name;
+ $language_name = t($language->name);
@spotzero
spotzero / connector-gives_hooks_a_change.patch
Last active August 29, 2015 14:04
Connector module, gives hooks a chance patch
diff --git a/connector.module b/connector.module
index 4e20102..da7d430 100644
--- a/connector.module
+++ b/connector.module
@@ -427,6 +427,7 @@ function _connector_log_in($connector_name, $cid = NULL, $consumer = NULL, $acce
else {
//Log in user
$form_state['uid'] = $account->uid;
+ $form_state['connector access token'] = $access_token;
user_login_submit(array(), $form_state);
diff --git a/oauthloginprovider.oauth.inc b/oauthloginprovider.oauth.inc
index 72a20d2..f2d3e00 100644
--- a/oauthloginprovider.oauth.inc
+++ b/oauthloginprovider.oauth.inc
@@ -26,6 +26,7 @@ function oauthloginprovider_default_oauth_common_context() {
'disable_auth_level_selection' => 1,
'signature_methods' => array('HMAC-SHA1', 'HMAC-SHA256', 'HMAC-SHA384', 'HMAC-SHA512'),
'default_authorization_levels' => array('user_info'),
+ 'automatic_authorization' => TRUE,
);
@spotzero
spotzero / oauth-behind-proxy.patch
Created April 23, 2014 22:08
Drupal's OAuth module for OAuth providers behind a proxy
diff --git a/lib/OAuth.php b/lib/OAuth.php
index 00ea0d5..15484d0 100644
--- a/lib/OAuth.php
+++ b/lib/OAuth.php
@@ -384,7 +384,7 @@ class OAuthRequest {
public function get_signature_base_string() {
$parts = array(
$this->get_normalized_http_method(),
- $this->get_normalized_http_url(),
+ $this->get_normalized_http_url(TRUE),
@spotzero
spotzero / gist:9276413
Created February 28, 2014 18:09
SVN Score Board
svn log https://svnrepo | grep -P '^r\d' | awk -F '|' '{print $2;}' | tr -d ' ' | sort | uniq -c | sort -n