Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php
index 6adb305..0fa8c30 100644
--- a/src/Plugin/views/display/Eva.php
+++ b/src/Plugin/views/display/Eva.php
@@ -205,10 +205,34 @@ class Eva extends DisplayPluginBase {
}
public function remove() {
- // clean up display configs before the display disappears
- $longname = $this->view->storage->get('id') . '_' . $this->display['id'];
diff --git a/src/Plugin/views/display/Eva.php b/src/Plugin/views/display/Eva.php
index 6adb305..0fa8c30 100644
--- a/src/Plugin/views/display/Eva.php
+++ b/src/Plugin/views/display/Eva.php
@@ -205,10 +205,34 @@ class Eva extends DisplayPluginBase {
}
public function remove() {
- // clean up display configs before the display disappears
- $longname = $this->view->storage->get('id') . '_' . $this->display['id'];
@ahebrank
ahebrank / matomo-custom-cache-contexts.patch
Last active December 4, 2018 13:01
patch Matomo (Piwik) module to expand cache context for user/global token custom vars
diff --git a/matomo.module b/matomo.module
index 036e359..97e17df 100644
--- a/matomo.module
+++ b/matomo.module
@@ -49,8 +49,11 @@ function matomo_page_attachments(array &$page) {
$id = $config->get('site_id');
$request = \Drupal::request();
- // Add module cache tags.
- $page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags());
@ahebrank
ahebrank / watchmirror.sh
Created November 30, 2017 18:32
mirror files from one place to another while you're working on them (e.g., plugin development with live testing on a site using it)
#!/bin/bash
CMD="notifyloop"
function show_help() {
echo "$0 [SRC] DEST"
echo " SRC and DEST are anything recognizable to rsync"
echo " if unspecified, SRC is pwd"
}
@ahebrank
ahebrank / ci_update_dependees.sh
Last active February 5, 2018 14:46
an attempt to update submodule dependees
#!/bin/bash
# what phrase in a commit message will trigger this?
TRIGGER="fix"
REPOS=$( cat .dependee_repos )
COMMIT_MESSAGE="$( git log -1 --pretty=%B | tr 'A-Z' 'a-z' )"
TMP=/tmp/repo
# get the current URL, but strip off the host and protocol
@ahebrank
ahebrank / com.newcity.docker_loopback.plist
Created March 7, 2018 15:47
launchctl to set a loopback for Docker xdebug
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.newcity.docker_loopback.plist</string>
<key>OnDemand</key>
<false/>
@ahebrank
ahebrank / FilterStripBlankHeadings.php
Created March 13, 2018 16:18
Drupal ckeditor filter to remove blank headings
<?php
namespace Drupal\MY_MODULE\Plugin\Filter;
use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase;
/**
* @Filter(
* id = "filter_strip_blank_headings",
@ahebrank
ahebrank / fullcalendar-title-tooltip.patch
Last active August 10, 2018 15:18
Patch Drupal fullcalendar to show full title on hover
diff --git a/assets/js/fullcalendar.fullcalendar.js b/assets/js/fullcalendar.fullcalendar.js
index 9ed1ffd..fb5a79b 100644
--- a/assets/js/fullcalendar.fullcalendar.js
+++ b/assets/js/fullcalendar.fullcalendar.js
@@ -106,6 +106,12 @@
fullcalendar.dateChange(view.start, view.end, settings['fullcalendar_fields']);
fullcalendar.fetchEvents();
}
+ },
+ eventRender: function(event, element, view) {
diff --git a/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php b/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php
index 2eeb3c3..95b26b7 100644
--- a/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php
+++ b/src/Plugin/Field/FieldFormatter/ViewfieldFormatterDefault.php
@@ -117,13 +117,6 @@ class ViewfieldFormatterDefault extends FormatterBase {
}
}
- // @todo Design and implement a caching strategy.
- $elements = [
@ahebrank
ahebrank / 42745.patch
Last active April 5, 2018 13:04
WP 4.x add $attachment_id to intermediate_image_sizes_advanced filter
From cb53982d1fbaa5ece8af043e71a58040a824f1f0 Mon Sep 17 00:00:00 2001
From: John Blackbourn <johnbillion@git.wordpress.org>
Date: Sat, 16 Dec 2017 13:47:47 +0000
Subject: [PATCH] Media: Pass the attachment ID to the
`intermediate_image_sizes_advanced` filter.
Props drywallbmb, robbie505
Fixes 42745
Built from https://develop.svn.wordpress.org/trunk@42407