bluecadet / bluecadet_utilities
Adds utilities to aide in development
Package info
github.com/bluecadet/bluecadet_utilities
Type:custom-drupal-module
pkg:composer/bluecadet/bluecadet_utilities
Requires
- php: ^8.2
- bluecadet/bc_drupal_package_manager: ^1.1
- composer/installers: ^1.9||^2.0
- drupal/core: ^10 || ^11
- oomphinc/composer-installers-extender: ^2.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 5.x-dev
- 5.1.0
- 5.0.x-dev
- 5.0.1
- 5.0.1-alpha.2
- 5.0.1-alpha.1
- 5.0.0
- 4.x-dev
- 4.2.2
- 4.2.1
- 4.2.0
- 4.2.0-rc.4
- 4.2.0-rc.3
- 4.2.0-rc.2
- 4.2.0-rc.1
- 4.1.2
- 4.1.1
- 4.1.1-beta1
- 4.1.1-alpha3
- 4.1.1-alpha2
- 4.1.1-alpha1
- 4.1.0
- 4.1.0-alpha2
- 4.1.0-alpha1
- 4.0.3
- 4.0.3-alpha3
- 4.0.3-alpha2
- 4.0.3-alpha1
- 4.0.2
- 4.0.2-alpha4
- 4.0.2-alpha3
- 4.0.2-alpha2
- 4.0.2-alpha1
- v4.0.1
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.6
- v2.0.5
- v2.0.4
- V2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.04
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- dev-feature/agents-md
- dev-feature/deprecate-file-validate-hook
- dev-feature/filter-formats-compat
- dev-feature/package-manager-metadata
- dev-feature/ci-matrix-refresh
- dev-feature/gitattributes-submodule-composer
- dev-feature/improve-test-coverage
- dev-feature/update-bc-tooling-deps
- dev-feature/ci-workflow-update
- dev-feature/readme-template-update
- dev-copilot/review-drupal-tests-workflow
- dev-ML-243-allow-renaming-core-title-field-to-administrative-title-d8440
- dev-archive/4.1
- dev-feature/entity-ref-field-search
- dev-archive/4.0
- dev-feature/text-field-search
- dev-feature/display-none-field-widget
- dev-feature/tests-display-title
- dev-archive/3.0
- dev-archive/2.0
- dev-bug/checkFileExists
- dev-archive/1.0
- dev-test-branch-1767031244381
This package is auto-updated.
Last update: 2026-10-07 17:32:11 UTC
README
Adds utilities to aid in development of custom sites.
Requirements
- Drupal 10 or Drupal 11
- PHP 8.2 or higher
Tested Drupal versions
CI tests against Drupal 10.6, 11.3, 11.4 and 11.5 (plus 12.0 as an early signal, expected to fail until Drupal 12 support lands). Drupal 10.5 and 11.2 are past end of life and no longer tested.
On Drupal 10.5.x or 11.2.x, pin twig/twig to <3.30 (composer require "twig/twig:<3.30" -W). Those cores register their escape filter under a different name than Twig 3.30's auto-escaping expects, which fatals on any render that uses it (for example item-list). Drupal 10.6+ and 11.3+ are unaffected.
Versions
5.x Branch
- 5.1.x: Drupal 10 & 11 compatible. Requires PHP 8.2+ (5.0.x declared 7.4+ but was only tested on 8.2+). Adds
extra.bluecadet-package-managermetadata. - 5.0.x: Drupal 10 & 11 compatible (PHP 7.4+ declared, 8.2+ tested). Breaking: Removed
FractalCompoundHandlesLoaderand thebluecadet_utilities.loader.fractal_compound_handlesTwig loader service. Sites relying on Fractal-style#handleor@namespace/componentsyntax in Twig templates must migrate to an alternative (e.g. Drupal core SDC or thecomponentscontrib module).- 5.0.1: CI modernization, PHPCS/PHPStan cleanup, and test coverage work. Removed the undocumented global
BCU_IMG_GEN_STATEconstant (useImageStyleGenSettings::STATE_KEYinstead); nothing in this module still references it.
- 5.0.1: CI modernization, PHPCS/PHPStan cleanup, and test coverage work. Removed the undocumented global
4.x Branch
- 4.2.x: Drupal 10 & 11 compatible.
- 4.1.x: Drupal 10 compatible. Due to twig file loading, easiest to keep separate branches for D9 and D10.
- 4.0.x: Drupal 9 compatible. Due to twig file loading, easiest to keep separate branches for D9 and D10.
3.x Branch — Drupal 8.9 and Drupal 9 compatible.
- Removed all code related to Paragraphs preview.
- Removed all code related to preview Display modes of nodes. This should now all be included in Core Previews.
2.x Branch — < Drupal 8.9 compatible.
1.x Branch — completely outdated, do not use.
Deprecated
Deprecated in 5.1.0, removed in 6.0.0:
- File name transliteration:
bluecadet_utilities_file_validate(),bluecadet_utilities_transliterate_filenames_transliteration(), thebluecadet_utilities.sanitize_nameservice (SanitizeName), and the "Enable File name transliteration" setting (use_transliteration). It only ran throughhook_file_validate(), which Drupal 11 removed, and relied on a$file->destinationproperty core no longer sets, so it does nothing on Drupal 11. Use Drupal core's file name sanitization instead.
Includes
- Theme for formatting svg files
- Transliteration for file uploads (Transliteration Module as Source) -- deprecated, see below
- Enable WYSIWYG on textfield fields
- Image Style generator, based on aspect ratios
- Text string search for searching html strings in text fields (eg, search for a specific link or class name being used)
Submodules
- bc_display_title: Provide functionality around the use of the display title field we normally use
- bc_sandbox: provide an easy page to play with
Not using Composer
If you are not using composer, you can delete all unneeded files.
- composer.json
Using Composer
If you are using composer to manage Drupal modules, make sure you add custom location for this module to be downloaded to. You must add the installer types line as well as the location for the module.
... "installer-types": ["custom-drupal-module"], "installer-paths": { "web/core": ["type:drupal-core"], "web/modules/contrib/{$name}": ["type:drupal-module"], "web/modules/custom/{$name}": ["type:custom-drupal-module"], "web/profiles/contrib/{$name}": ["type:drupal-profile"], "web/themes/contrib/{$name}": ["type:drupal-theme"], "drush/contrib/{$name}": ["type:drupal-drush"] }, ...
Testing
This module includes automated tests that run via GitHub Actions against Drupal 10.5.x-10.6.x and 11.2.x-11.3.x (see .github/workflows/drupal-tests-and-standards.yml for the exact PHP/MariaDB matrix).
Test Plan
Automated Tests (GitHub Actions)
The CI pipeline runs the following for each Drupal version:
- PHPCS - Drupal coding standards validation (
DrupalandDrupalPracticestandards) - PHPStan - static analysis for deprecated API usage (via
mglaman/phpstan-drupal) - PHPUnit - Unit, Kernel, and Functional tests, with code coverage reporting
Current coverage
~91% line coverage across src/ and both submodules.
- Unit tests for pure logic:
SanitizeName,SimpleFormatTextfield,DrupalStateTrait - Kernel tests for Drupal-integrated behavior: field formatters/widgets, settings forms, the image style generator, and the entity-reference/text-field search tools (including their batch pipelines)
- Functional test (
BluecadetUtilitiesTest) exercising the module against a real content type and admin routes
Changelog
5.0.1
- Refreshed the CI matrix: dropped end-of-life Drupal 10.5.x and 11.2.x, now testing 10.6.x, 11.3.x, 11.4.x and 11.5.x, with 12.0.x as an early (expected to fail) signal
- Documented the Twig 3.30 incompatibility on Drupal 10.5.x/11.2.x (pin
twig/twigto<3.30) and corrected the PHP requirement wording (7.4+ declared, 8.2+ tested) - Removed the undocumented global
BCU_IMG_GEN_STATEconstant (useImageStyleGenSettings::STATE_KEY) - Known issue:
filter_formats()is deprecated in Drupal 11.4; replacement planned for 5.1.0
5.0.1-alpha.2
- Bumped
@bluecadet/dropsto^1.2.0andpostcss-advanced-variablesto^5.0.0(CVE fix; verified byte-identicalassets/distoutput before/after), removed the unusedconcurrentlydevDependency - Moved CI to a shared, config-driven orchestrator in
bluecadet/web-gh-actions-- the test matrix now lives in.github/drupal-ci.ymlinstead of being hand-copied in this repo's own workflow file
5.0.1-alpha.1
- Modernized CI to a reusable-workflow architecture, matrix-tested against Drupal 10.5.x-10.6.x and 11.2.x-11.3.x across PHP 8.2-8.4
- Fixed all PHPCS/PHPStan violations, including converting
EntityReferenceFieldSearch,TextFieldSearch, andImageStyleGeneratorto real constructor-based dependency injection and removing dead/duplicate code - Fixed a PCOV bug that was silently reporting 0% test coverage in CI, and raised automated test coverage from ~5% to ~91% (Unit and Kernel tests across forms, field formatters/widgets, and both submodules)
- Bumped
@bluecadet/bldrto2.0.0-alpha.12,@bluecadet/dropsto^1.1.0, andbluecadet/bc_drupal_package_managerto^1.1; disabled bldr's new v2 ESLint/Stylelint providers since this repo has no config for either - Excluded the submodules'
composer.jsonstubs (added purely to break out per-submodule CI coverage reporting) from the release tarball via.gitattributes
5.0.0
- Adding in basic text search.
- Breaking: Removed
FractalCompoundHandlesLoaderand thebluecadet_utilities.loader.fractal_compound_handlesTwig loader service. Sites relying on Fractal-style#handleor@namespace/componentsyntax in Twig templates must migrate to an alternative (e.g. Drupal core SDC or thecomponentscontrib module).
4.2.x
- Enforcing Drupal 11 compatibility.
- Bug fixes for
simple-formatter.js - Update bldr to 1.1.0
- Add in schema definitions for widget and formatter settings
4.1.1
- Updating dev tools. Drupal module not really effected.
- Update SimpleFormatWidget to handle text fields and the "format" subfield, so it doesn't store null in DB
4.1.0
- D10 compatibility
- Updated twig handler for D10
4.0.3
- Updating dev tools. Drupal module not really effected.
4.0.2
- Adding in utilities for github/building/composer etc.
4.0.1
- Added in Image Style generator.
- Added Simple Format Formatter so we can have min html in a text field.
- Updated simple Format formatter styles for buttons in Claro
- Added formatter settings if you want to run the text through a system text formatter.
8.x-3.0.3
- Update FractalCompoundHandlesLoader class to use new components API
- Fix multiple uses of the simple formatter
8.x-3.0.2
- Updated dependencies so we can use Composer v2
8.x-3.0.1
- Added in styles for Claro Admin theme.