Skip to content

Instantly share code, notes, and snippets.

@szeidler
szeidler / colordialog-d9-support-3135491-18.patch
Created September 7, 2020 14:19
D9 non-libraries support for colordialog
diff --git a/colordialog.info.yml b/colordialog.info.yml
index 090bf73..ccac3a3 100644
--- a/colordialog.info.yml
+++ b/colordialog.info.yml
@@ -2,7 +2,7 @@ name: CKEditor Color Dialog
type: module
description: "Adds in the Color Dialog plugin for CKEditor."
package: CKEditor
-core: 8.x
+core_version_requirement: ^8 || ^9
@szeidler
szeidler / rollback-module-update.sh
Created January 12, 2021 14:53
Rollback Drupal module schema version after update
#!/bin/bash
drush php-eval "drupal_set_installed_schema_version('your_module', 8001);"
@szeidler
szeidler / gutenberg-regenerate-translations-file.patch
Created January 14, 2021 10:16
Regenerated translations file for Gutenberg 8.x-2.0-beta2, which was missing translations
diff --git a/js/drupal-gutenberg-translations.js b/js/drupal-gutenberg-translations.js
index c00f2f2..2ca1e3b 100644
--- a/js/drupal-gutenberg-translations.js
+++ b/js/drupal-gutenberg-translations.js
@@ -2,1212 +2,1750 @@
File generated by drupal-gutenberg-translations tool.
*/
/*
- Drupal.t('Field');
- Drupal.t('Field block.');
@szeidler
szeidler / EmbedSubscriber.php
Created July 5, 2021 09:25
Whitelist specific pages for iframe embedding by removing the X-Frame-Options header in Drupal
<?php
// REMOVE ME: Place in /web/modules/custom/mymodule/src/EventSubscriber/EmbedSubscriber.php
namespace Drupal\mymodule_embed\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
diff --git a/.travis.yml b/.travis.yml
index 623d2f8..575bec6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,7 +51,7 @@ before_script:
# 24 October 2020 this bumped the version to Composer 2. Drupal Core 8.8 has
# plugins that only run with composer-plugin-api ^1.0 so revert to Composer 1.
- if [ "$DRUPAL_CORE" == "8.8.x" ]; then
- travis_retry composer self-update --1;
+ travis_retry composer self-update --1;
diff --git a/scheduler.module b/scheduler.module
index 4e959da..98c1ee1 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -287,9 +287,12 @@ function _scheduler_entity_type_form_alter(&$form, FormStateInterface $form_stat
/** @var \Drupal\Core\Entity\EntityTypeInterface $type */
$type = $form_state->getFormObject()->getEntity();
- /** @var Drupal\Core\Entity\ContentEntityTypeInterface $ContentEntityType */
+ /** @var Drupal\Core\Entity\ContentEntityTypeInterface $contentEntityType */
@szeidler
szeidler / scheduler-entity-agnostic-scheduler_content_moderation_integration.patch
Created July 28, 2021 16:43
Support scheduler entity agnostic changes in scheduler_content_moderation_integration
diff --git a/src/EventSubscriber/SchedulerEventSubscriber.php b/src/EventSubscriber/SchedulerEventSubscriber.php
index ff46ac3..1025ff3 100644
--- a/src/EventSubscriber/SchedulerEventSubscriber.php
+++ b/src/EventSubscriber/SchedulerEventSubscriber.php
@@ -30,7 +30,9 @@ class SchedulerEventSubscriber implements EventSubscriberInterface {
public function publishImmediately(SchedulerEvent $event) {
/** @var \Drupal\node\Entity\Node $node */
$node = $event->getNode();
- $node->set('moderation_state', $node->publish_state->getValue());
+ if ($node->hasField('moderation_state')) {
diff --git a/publication_date.install b/publication_date.install
index df9495a..b9090b0 100755
--- a/publication_date.install
+++ b/publication_date.install
@@ -34,3 +34,19 @@ function _publication_date_update_existing() {
->from($nids)
->execute();
}
+
+/**
@szeidler
szeidler / 3224340.patch
Last active August 16, 2021 11:32
drupal/scheduler Hardcoded local task dependency on view scheduler_scheduled_content https://www.drupal.org/project/scheduler/issues/3224340
diff --git a/scheduler.links.task.yml b/scheduler.links.task.yml
index fed60f7..88810ac 100644
--- a/scheduler.links.task.yml
+++ b/scheduler.links.task.yml
@@ -10,22 +10,6 @@ scheduler.cron_tab:
weight: 10
base_route: scheduler.admin_form
-content_moderation.content:
- # Use content_moderation.content which is the same key as is used in the core
@szeidler
szeidler / check-php-compatibility.sh
Created October 26, 2021 09:20
Check code for PHP compatibility issues
#!/bin/bash
# Installation:
# - composer global require "squizlabs/php_codesniffer"
# - composer global require phpcompatibility/php-compatibility
phpcs -p . --standard=PHPCompatibility --runtime-set testVersion 7.4