From 0d359f81d6ac203ea8d962dcd93d1f63859fc854 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 29 May 2025 15:57:40 +0100 Subject: [PATCH] Add drupal/rel_to_abs For daily emails, I want all links to be absolute URLs so they work when embedded in the sent emails. This module does this. As there is no Drupal 11 compatible release, I've had to add the Lenient Composer endpoint and add patch the rel_to_abs module to make it D11 compatible. If everything works, I'll update the issue and mark it as RTBC. https://www.drupal.org/project/rel_to_abs https://www.drupal.org/docs/develop/using-composer/using-the-drupal-lenient-composer-plugin https://github.com/cweagans/composer-patches https://www.drupal.org/project/rel_to_abs/issues/3434164 --- composer.json | 15 ++- composer.lock | 164 +++++++++++++++++++++++- config/sync/core.extension.yml | 1 + config/sync/filter.format.full_html.yml | 25 ++++ 4 files changed, 203 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b6ae71ae0..ab8087aaf 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ ], "require": { "composer/installers": "^2.3", + "cweagans/composer-patches": "^1.7", "drupal/core-composer-scaffold": "^11.1", "drupal/core-project-message": "^11.1", "drupal/core-recommended": "^11.1", @@ -25,10 +26,12 @@ "drupal/paragraphs": "^1.19", "drupal/pathauto": "^1.13", "drupal/redirect": "^1.11", + "drupal/rel_to_abs": "^2.2", "drupal/tome": "^1.13", "drupal/twig_tweak": "^3.4", "drupal/weight": "^3.6", - "drush/drush": "^13.5" + "drush/drush": "^13.5", + "mglaman/composer-drupal-lenient": "^1.0" }, "conflict": { "drupal/drupal": "*" @@ -38,9 +41,11 @@ "config": { "allow-plugins": { "composer/installers": true, + "cweagans/composer-patches": true, "dealerdirect/phpcodesniffer-composer-installer": true, "drupal/core-composer-scaffold": true, "drupal/core-project-message": true, + "mglaman/composer-drupal-lenient": true, "php-http/discovery": true, "phpstan/extension-installer": true, "tbachert/spi": true @@ -105,6 +110,14 @@ " * Remove the plugin that prints this message:", " composer remove drupal/core-project-message" ] + }, + "drupal-lenient": { + "allowed-list": ["drupal/rel_to_abs"] + }, + "patches": { + "drupal/rel_to_abs": { + "Automated Drupal 11 compatibility fixes for rel_to_abs": "https://www.drupal.org/files/issues/2024-03-24/rel_to_abs.2.2.5.rector.patch" + } } }, "scripts": { diff --git a/composer.lock b/composer.lock index 8c1bd056c..3cb6aa3f3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "65c9a634f0c9f8b658fc062df72b47fc", + "content-hash": "b416719d22f3a349db2397ff583ef13f", "packages": [ { "name": "asm89/stack-cors", @@ -811,6 +811,54 @@ }, "time": "2024-12-13T19:25:56+00:00" }, + { + "name": "cweagans/composer-patches", + "version": "1.7.3", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" + }, + "time": "2022-12-20T22:53:13+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.3", @@ -2589,6 +2637,62 @@ "source": "https://git.drupalcode.org/project/redirect" } }, + { + "name": "drupal/rel_to_abs", + "version": "2.2.5", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/rel_to_abs.git", + "reference": "2.2.5" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/rel_to_abs-2.2.5.zip", + "reference": "2.2.5", + "shasum": "0a5727dd470872aeb04a59aff332d23b4a4b34c0" + }, + "require": { + "drupal/core": "^8 || ^9 || ^10 || ^11 || ^12" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.2.5", + "datestamp": "1689234025", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "andrii.tiupa", + "homepage": "https://www.drupal.org/user/2932651" + }, + { + "name": "danylevskyi", + "homepage": "https://www.drupal.org/user/322039" + }, + { + "name": "podarok", + "homepage": "https://www.drupal.org/user/116002" + }, + { + "name": "sanchiz", + "homepage": "https://www.drupal.org/user/1671246" + } + ], + "description": "Filter for convertion of relative paths to absolute URLs", + "homepage": "https://www.drupal.org/project/rel_to_abs", + "support": { + "source": "https://git.drupalcode.org/project/rel_to_abs" + } + }, { "name": "drupal/robotstxt", "version": "1.6.0", @@ -4704,6 +4808,64 @@ }, "time": "2024-07-23T14:00:32+00:00" }, + { + "name": "mglaman/composer-drupal-lenient", + "version": "1.0.7", + "source": { + "type": "git", + "url": "https://github.com/mglaman/composer-drupal-lenient.git", + "reference": "bcb9be7f2d3160be43cd1d13a44580734a5afee0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mglaman/composer-drupal-lenient/zipball/bcb9be7f2d3160be43cd1d13a44580734a5afee0", + "reference": "bcb9be7f2d3160be43cd1d13a44580734a5afee0", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": ">=8.1" + }, + "require-dev": { + "composer/composer": "^2.3", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.6", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.6" + }, + "type": "composer-plugin", + "extra": { + "class": "ComposerDrupalLenient\\Plugin" + }, + "autoload": { + "psr-4": { + "ComposerDrupalLenient\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Matt Glaman", + "email": "nmd.matt@gmail.com" + } + ], + "support": { + "issues": "https://github.com/mglaman/composer-drupal-lenient/issues", + "source": "https://github.com/mglaman/composer-drupal-lenient/tree/1.0.7" + }, + "funding": [ + { + "url": "https://github.com/mglaman", + "type": "github" + } + ], + "time": "2024-11-21T15:59:26+00:00" + }, { "name": "mtownsend/xml-to-array", "version": "2.0.0", diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index 2da524b4a..b8032ff35 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -54,6 +54,7 @@ module: path: 0 path_alias: 0 redirect: 0 + rel_to_abs: 0 robotstxt: 0 search: 0 seo_checklist: 0 diff --git a/config/sync/filter.format.full_html.yml b/config/sync/filter.format.full_html.yml index 326b358a1..932a33c4a 100644 --- a/config/sync/filter.format.full_html.yml +++ b/config/sync/filter.format.full_html.yml @@ -4,6 +4,8 @@ status: true dependencies: module: - editor + - markdown_easy + - rel_to_abs _core: default_config_hash: vpZysv3RHJjhYzq7O_q5q8mVlHdrSzKELmXyiX6RtV0 name: 'Full HTML' @@ -28,6 +30,15 @@ filters: status: true weight: 9 settings: { } + filter_html: + id: filter_html + provider: filter + status: false + weight: -10 + settings: + allowed_html: '' + filter_html_help: true + filter_html_nofollow: false filter_htmlcorrector: id: filter_htmlcorrector provider: filter @@ -40,3 +51,17 @@ filters: status: true weight: 15 settings: { } + markdown_easy: + id: markdown_easy + provider: markdown_easy + status: false + weight: 0 + settings: + flavor: standard + tips: '' + rel_to_abs: + id: rel_to_abs + provider: rel_to_abs + status: true + weight: 0 + settings: { }