Skip to content

Instantly share code, notes, and snippets.

@nelson-ph
nelson-ph / options.zsh
Created October 25, 2017 13:31 — forked from prat0318/options.zsh
`options` command to show all the aliases and functions offered by plugins you have installed via oh-my-zsh
RED=`tput setaf 1`
NOCOLOR=`tput sgr0`
function options() {
PLUGIN_PATH="$HOME/.oh-my-zsh/plugins/"
for plugin in $plugins; do
echo "\n\n${RED}Plugin: $plugin${NOCOLOR}";
if [ -d $PLUGIN_PATH$plugin ]; then
grep -r "^function \w*" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/()//'| tr '\n' ', '; grep -r "^alias" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/=.*//' | tr '\n' ', '
else
@nelson-ph
nelson-ph / filefield_paths_media_thumbnail_error.patch
Created May 18, 2018 14:07
Drupal 8 - Prevent Call to undefined method Drupal\\Core\\Field\\BaseFieldDefinition::getThirdPartySettings
Index: ./filefield_paths.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ./filefield_paths.module (date 1517934386000)
+++ ./filefield_paths.module (date 1517934386000)
@@ -344,13 +344,15 @@
if ($field instanceof FileFieldItemList) {
/** @var FieldConfig $definition */
@nelson-ph
nelson-ph / media_devel_generate.patch
Created May 24, 2018 06:58
Provides a MediaDevelGenerate plugin.
Index: ./modules/media/src/Plugin/DevelGenerate/MediaDevelGenerate.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- ./modules/media/src/Plugin/DevelGenerate/MediaDevelGenerate.php (date 1517935516000)
+++ ./modules/media/src/Plugin/DevelGenerate/MediaDevelGenerate.php (date 1517935516000)
@@ -0,0 +1,448 @@
+<?php
+
@nelson-ph
nelson-ph / composer_generate.fix_packages_versions.patch
Created May 28, 2018 13:02
Fix drush composer_generate packages versions to packagist.
Index: composer_generate.drush.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- composer_generate.drush.inc (date 1527512472000)
+++ composer_generate.drush.inc (date 1527512472000)
@@ -166,6 +166,7 @@
// formats are acceptable in the Drupal packagist projects, and
// force simplification of those which are not.
@nelson-ph
nelson-ph / drupal.legal.8.x-1.0-beta1-fix-missing-language-manager.patch
Last active September 3, 2018 15:39
Drupal Legal module - fix Call to a member function getCurrentLanguage() on null in Drupal\legal\Form\LegalAdminTermsForm->buildForm() (line 42
@nelson-ph
nelson-ph / drupal.legal.8.x-1.0-beta1-fix-modal-dialog-library.patch
Last active September 3, 2018 15:32
Drupal Legal module - fix modal/dialog library
@nelson-ph
nelson-ph / drupal.password_policy.8.x-3.0-alpha4-fix-roles-value-on-submit.patch
Last active July 17, 2018 12:38
Drupal Password legacy module - fix $roles value on submit
Index: password_policy.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- password_policy.module (date 1531830899000)
+++ password_policy.module (date 1531830899000)
@@ -170,6 +170,10 @@
}
@nelson-ph
nelson-ph / drupal.composed_field.7.x-1.x-dev.module.presave_support_serialized_string.patch
Created August 1, 2018 14:00
Drupal 7 Composed Field debug saving node when the value is not unserialized
--- ./composed_field.module 2017-12-18 11:32:07.000000000 +0100
+++ ./composed_field.module 2017-12-18 11:30:28.000000000 +0100
@@ -228,6 +228,9 @@
foreach ($items as $delta => $item) {
$all_subfields_have_value = FALSE;
+ if(is_string($item['composed'])){
+ $item['composed'] = unserialize($item['composed']);
+ }
foreach ($item['composed'] as $subfield_value) {
@nelson-ph
nelson-ph / drupal.core.8.x-fix-legacy-messenger-delete-by-type.patch
Last active September 25, 2018 10:41
Fix LegacyMessenger::deleteByType
Index: core/lib/Drupal/Core/Messenger/LegacyMessenger.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/lib/Drupal/Core/Messenger/LegacyMessenger.php (date 1537871717000)
+++ core/lib/Drupal/Core/Messenger/LegacyMessenger.php (date 1537871717000)
@@ -180,7 +180,7 @@
public function deleteByType($type) {
// Proxy to the Messenger service, if it exists.
@nelson-ph
nelson-ph / drupal.redis.8.x-sessions-fix-attribute-bag-usage
Created October 3, 2018 07:23
Drupal 8 Redis sessions Attribute Bag fix
Index: modules/redis_sessions/src/RedisSessionsSessionManager.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules/redis_sessions/src/RedisSessionsSessionManager.php (date 1538551207000)
+++ modules/redis_sessions/src/RedisSessionsSessionManager.php (date 1538551207000)
@@ -169,7 +169,7 @@
private function getSessionBagUid() {
foreach ($this->bags as $bag) {