Install
Works with Drupal: ^9 || ^10 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
A maintenance release on top of 3.0.0. Recommended for all 3.0.0 sites.
Upgrading
composer update drupal/sharerichNo database updates and no configuration changes. Drupal 9, 10, 11 and 12, PHP 8.1 or newer, as before.
The filter_protocols parameter is no longer redefined
#3619610. The module used to redefine Drupal's filter_protocols container parameter so the Print and WhatsApp buttons could keep their javascript: and whatsapp: URLs.
It has been removed. Nothing replaces it, because js/sharerich.js already restored both protocols on the client — those workarounds existed precisely because Drupal strips them server-side
Two things to be aware of. The Print and WhatsApp buttons now need JavaScript; with it disabled they do nothing, while the other buttons are unaffected.
The url, title, summary and description tokens are advertised
#3619609. hook_tokens() replaced ten tokens while hook_token_info() advertised only six. The four missing ones were [sharerich:url], [sharerich:title], [sharerich:summary] and [sharerich:description].
They always worked, so nothing was broken; they simply never appeared in the token browser. Since every button the module ships uses [sharerich:url] and [sharerich:title], anyone writing a custom button had to copy an existing one and guess. All ten are now listed, each documenting the fallback chain it walks through node, taxonomy term, current page and site.
Test coverage
The token layer and the JavaScript behaviours had no coverage at all. Both now do:
| Type | Tests | Covers |
|---|---|---|
| Unit | 4 | Every token replaced is also advertised, so the two cannot drift apart again |
| Kernel | 9 | Token replacement and fallbacks; protocol filtering behaves as core intends |
| Functional | 13 | Admin UI, routes, config schema, the rendered block |
| Functional JavaScript | 4 | Reset button, protocol restoration, no jQuery, button wrapping |
All of it passes on Drupal 9, 10, 11 and 12.
Also in this release
- #3619608 — the CI pipeline reported success even when phpcs, phpstan, stylelint, ESLint or CSpell failed, because the shared template marks those jobs as allowed to fail. They now fail the pipeline.