Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Froehlich a-fro

  • Cornell University
  • Ithaca, NY
View GitHub Profile
View debug.patch
diff --git a/src/SamlService.php b/src/SamlService.php
index 1f22efb..98e8c03 100644
--- a/src/SamlService.php
+++ b/src/SamlService.php
@@ -129,6 +129,8 @@ class SamlService {
public function getMetadata() {
$settings = $this->getSamlAuth()->getSettings();
$metadata = $settings->getSPMetadata();
+ dump($metadata);
+ dump(simplexml_load_string($metadata));
View MenuGraftHelper.php
<?php
namespace Drupal\menu_graft;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\menu_link_content\MenuLinkContentInterface;
/**
* Class MenuGraftHelper.
*
View paragraphs-preview-no-output-layout-builder.patch
diff --git a/src/Controller/ParagraphsPreviewController.php b/src/Controller/ParagraphsPreviewController.php
index 3fe50c4..924c75f 100644
--- a/src/Controller/ParagraphsPreviewController.php
+++ b/src/Controller/ParagraphsPreviewController.php
@@ -176,6 +176,13 @@ class ParagraphsPreviewController extends ControllerBase {
// EntityViewBuilder::viewFieldItem().
$elements = $parent_clone->{$parent_field_name}->view($parent_view_mode);
+ // When layout builder is enabled for an entity, viewBuilder->view_field()
+ // returns and empty array. Using default display options instead returns
View menu_condition_parent_selection_fix.patch
diff --git a/src/Plugin/Condition/MenuPosition.php b/src/Plugin/Condition/MenuPosition.php
index 89e640a..099b6c0 100644
--- a/src/Plugin/Condition/MenuPosition.php
+++ b/src/Plugin/Condition/MenuPosition.php
@@ -97,10 +97,9 @@ class MenuPosition extends ConditionPluginBase implements ConditionInterface, Co
*/
public function summary() {
list($menu_name, $link_plugin_id) = explode(':', $this->configuration['menu_parent'], 2);
- $menu_link = $this->pluginManagerMenuLink->createInstance($link_plugin_id);
return $this->t(
View confirm-menu-name-3099361-2.patch
diff --git a/menu_svg_icons.module b/menu_svg_icons.module
index 7ff6e74..601d52f 100644
--- a/menu_svg_icons.module
+++ b/menu_svg_icons.module
@@ -232,6 +232,10 @@ function menu_svg_icons_preprocess_block(&$variables) {
* Implements hook_preprocess_HOOK().
*/
function menu_svg_icons_preprocess_menu(&$variables) {
+ // Make sure there is a menu_name key
+ if (!isset($variables['menu_name'])) {
@a-fro
a-fro / device-support.css
Created Nov 15, 2019
Device support media queries
View device-support.css
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
/* ... */
}
/* stylus-based screens */
@media (hover: none) and (pointer: fine) {
/* ... */
}
/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {
View ClassFilterSubscriber.php
<?php
namespace Drupal\ilr_registrations\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\commerce_product\Event\ProductEvents;
use Drupal\commerce_product\Event\FilterVariationsEvent;
/**
View ilr_registrations.services.yml
services:
ilr_registrations.default:
class: Drupal\ilr_registrations\EventSubscriber\ClassFilterSubscriber
arguments: []
tags:
- { name: event_subscriber }
@a-fro
a-fro / reinstall
Created Apr 12, 2018
Drupal reinstall script
View reinstall
#!/bin/bash
drush si config_installer config_installer_sync_configure_form.sync_directory=../config/sync --account-pass=admin --account-name="admin" -y
View field_layout.routing.yml
# @todo Refactor to use a dynamic RouteSubscriber
field_layout.change_layout:
path: 'admin/structure/types/manage/change-layout/{entity_type}/{bundle}/{display_mode}/{new_layout}'
defaults:
_form: '\Drupal\field_layout\Form\FieldLayoutEntityLayoutEditForm'
_title: 'Change layout'
requirements:
_permission: 'admin fields'
You can’t perform that action at this time.