13.11.2025 | Pascal Crott

Fix broken media previews

media-install.sh
drush php-eval "\Drupal::moduleHandler()->loadInclude('media', 'install');media_install();";

Issue:

The error log is full of the warning "Warning: copy(public://media-icons/generic/generic.png)" and the media library shows no previews. This can happen when environments are set up based on a database dump and without properly transferring the files. The media icons are usually created during the installation of the media module, which will never happen in this scenario.

Devbit broken media preview icons

Solution:

Trigger the install hook of the Core Media module. It will take care of creating those files. Use the provided snippet.

See also https://www.drupal.org/project/drupal/issues/3060509

Weitere DevBits

13.11.2025 | Peter Majmesku

Install the Latest GitFlow Version on macOS

sh
15.01.2026 | Mathias Grab

Show installed module information via composer

terminal.sh
# Syntax.
composer show vendor/package

# Example.
composer show drupal/eca

terminal_result.sh
name     : drupal/eca
descrip. : Event, Conditions, Actions - powerful, versatile, and user-friendly rules engine for Drupal
keywords : 
versions : * 2.1.0
type     : drupal-module
license  : GNU General Public License v2.0 or later (GPL-2.0-or-later) (OSI approved) https://spdx.org/licenses/GPL-2.0-or-later.html#licenseText
homepage : https://www.drupal.org/project/eca
source   : [git] https://git.drupalcode.org/project/eca.git 2.1.0
dist     : [zip] https://ftp.drupal.org/files/projects/eca-2.1.0.zip 2.1.0
path     : /var/www/html/web/modules/contrib/eca
names    : drupal/eca

support
source : https://drupal.org/project/eca
issues : https://drupal.org/project/issues/eca

requires
dragonmantank/cron-expression ^3.1
drupal/core ^10.3||^11
ext-dom *
ext-json *
mtownsend/xml-to-array ^2.0
php >=8.1

requires (dev)
drupal/eca_ui *
drupal/entity_reference_revisions ^1.12
drupal/inline_entity_form ^3.0
drupal/paragraphs ^1.18
drupal/token ^1.15
drupal/webform dev-3465838-drupal-11-compatibility

sh
composer