10 votes
Accepted

How can I change allowed tags in CKEditor 5?

Like in earlier Drupal versions WYSIWYG editor settings can be configured per text format. For example, under /admin/config/content/formats/manage/basic_html you configure the editor used for the &...
leymannx's user avatar
  • 18.1k
8 votes
Accepted

How can I find out if all my contrib modules are compatible with the latest core version?

If by "latest core version" you mean moving from one major version to another (for example, 9 to 10), you can use the Upgrade Status module. In addition to telling you whether each contrib ...
Patrick Kenny's user avatar
8 votes
Accepted

Struggling to enable twig debugging

Since Drupal 10.1.0 Twig debugging seems to be actived/deactivated according some settings stored in the state table: Change record. This prevents that these settings can be accidentally committed. ...
leymannx's user avatar
  • 18.1k
6 votes
Accepted

Why are media items no longer available at /media/{id}?

This was an announced change that released in Drupal 8.7.0—"Media items no longer available at /media/{id}". The change added a new setting to enable the "id" route and turned it ...
cilefen's user avatar
  • 5,967
5 votes
Accepted

How can I patch a Composer dependency to make the dependency compatible with other dependency versions?

composer update is run before patches are applied, which is why your patch is not working, as it is not seeing the patched version yet, and therefore finds incompatibilities. See this link for ...
Jaypan's user avatar
  • 17.6k
5 votes
Accepted

How to do dependency injection for ConstraintValidator?

To pass the argument implement ContainerInjectionInterface::create(). For example: class TaxonomyTermHierarchyConstraintValidator extends ConstraintValidator implements ContainerInjectionInterface { ...
4uk4's user avatar
  • 99.8k
5 votes

Does CKEditor5 have an embed button like CKEditor4?

This is because the entity embed module does not support CKEditor5 yet - mainly because the way plugins are written in CKEditor5 is different than CKEditor4. The status looks good. I think you can get ...
AjitS's user avatar
  • 10.9k
4 votes
Accepted

Problem with PHP version on Ubuntu on Windows when installing Drush

You’re executing PHP on your local machine, which has PHP 8.2 installed. You’re executing composer inside the VM, which has PHP 8.0 installed. You need to upgrade PHP inside your VM. See Extending and ...
Clive's user avatar
  • 167k
4 votes
Accepted

Class arguments not being passed

The error message states that no arguments are being passed to the Twig filter extension. Drupal Twig filter extensions must be defined in [MODULE].services.yml, and in that service definition, the ...
Jaypan's user avatar
  • 17.6k
4 votes
Accepted

How can I change the query string used in pages showing search results from keys=football to keyword=football?

URLs output by Drupal can be altered by a tagged service that uses a class which implements two interfaces: OutboundPathProcessorInterface and InboundPathProcessorInterface. (I use links for Drupal 9 ...
apaderno's user avatar
  • 97.5k
4 votes

Is the libmysqlclient version core requirement actually required?

The issue was resolved and the error cleared by changing the PHP library from libmysqlclient to MySQLnd - that is, enabling nd_pdo_mysql instead of pdo_mysql.
Peladon's user avatar
  • 59
4 votes
Accepted

Get the node that a block is placed on without a route parameter?

A block placed in Layout Builder can load the entity context: $entity = $this->getContextValue('entity'); This works in the block build method. If you are altering an existing block you can use a ...
4uk4's user avatar
  • 99.8k
4 votes

Why does this JavaScript once implementation not work?

The new once() function from the new v10 core/once library always returns an array of elements (even if the selector matches only a single element). And vanilla JS arrays don't have a .on() function. ...
Hudri's user avatar
  • 5,500
4 votes
Accepted

Why isn't Drupal's core once() function working in my simple test script?

core/once isn't for doing something just once, but for attaching a script just once. Then it's up to your script's logic to actually do something just once. You could for example toggle a simple CSS ...
leymannx's user avatar
  • 18.1k
4 votes
Accepted

How can I invalidate the entire cache when saving menu item?

The Simplify Menu module has the problem that it doesn't transport cache metadata and a code like \Drupal::cache()->invalidateAll() doesn't exist. You can add the most important cache tag to the ...
4uk4's user avatar
  • 99.8k
3 votes
Accepted

Is there a way to use jQuery?

jQuery is still included in Drupal 10.1core. If it would be removed in the future you would actually add a libraries file: https://www.drupal.org/docs/creating-custom-modules/adding-assets-css-js-to-a-...
cilefen's user avatar
  • 5,967
3 votes
Accepted

Can I add classes to individual menu links?

The Menu Link Attributes contrib module adds the option to assign each menu link a class in the admin UI.
Patrick Kenny's user avatar
3 votes

Unable to upgrade from Drupal 9.5.10 to 10.1.1

I was able to upgrade from 9.5.10 to 10.1.1 using a number of the comments and solutions listed here so just wanted to have it in one place, in case someone else hits the wall like I did: First, ...
alex's user avatar
  • 51
3 votes
Accepted

Website doesn't load properly from htdocs/web

This is very limited shared-hosting, no control panel and no way to edit apache's configs, only .htacess files accessible in htdocs Look for a new hosting company, until then you can use the legacy ...
4uk4's user avatar
  • 99.8k
3 votes

Why does this JavaScript once implementation not work?

jQuery Once was deprecated in Drupal 9 and removed from Drupal 10. The change record includes a conversion guide.
cilefen's user avatar
  • 5,967
3 votes
Accepted

Get the view object in a custom block plugin

To Get View object in custom block plugin you can follow this snippet code: (Drupal 9/10) use Drupal\views\Views; // Get current route object. $route = \Drupal::routeMatch()->getRouteObject(); ...
mini_poojasharma's user avatar
3 votes
Accepted

What is the approach for autocompletion of links in CKEditor5?

At the time I write this, it is necessary to install and enable LinkIt on desired text formats in Drupal 10 to enable this feature. Yes, there is a Core issue to bring LinkIt features into Core but ...
cilefen's user avatar
  • 5,967
3 votes
Accepted

How can I rebuild the cache for a specific route when a node of type foo is updated?

The cache tag node_list:foo is correct. But I've never seen that you can add it to a route like this. Normally the route controller returns the cache metadata in $build: public function page() { // ...
4uk4's user avatar
  • 99.8k
3 votes

How do I replace hook_field_widget_WIDGET_TYPE_form_alter() with hook_field_widget_complete_WIDGET_TYPE_form_alter()?

hook_field_widget_WIDGET_TYPE_form_alter() is replaced by hook_field_widget_single_element_WIDGET_TYPE_form_alter(). See the change record Streamline Field Widget Hooks. It's not replaced by ...
4uk4's user avatar
  • 99.8k
3 votes

How to format a view to show content but without a teaser?

I advise you to use content rather than fields. In view content, you can choose a view mode. Choose the view mode that suits you (full, teaser) or you can create one for your needs. In this example, ...
Sébastien Gicquel's user avatar
3 votes
Accepted

How to run global PHP?

Really global would be index.php. But don't change this file. Drupal doesn't want you to change any core files, so they've implemented stacked middlewares where you can run your PHP code before or ...
4uk4's user avatar
  • 99.8k
3 votes

Is there a starter theme? If so what is it?

The most popular are (counting only Drupal 8/9/10): 58777 Bootstrap 45522 Stable 33665 Barrio Bootstrap 5 Theme The contrib Stable is used to upgrade Drupal 8/9 sites, it shouldn't be used for new ...
4uk4's user avatar
  • 99.8k
3 votes
Accepted

PhpUnit 9.6.16 with Drupal 10.2 unable to write to output directory: How to fix that error?

I am not sure why this was changed, but starting with Drupal 10.2.0, the BROWSERTEST_OUTPUT_DIRECTORY variable is no longer relative to the DOCROOT at /var/www/html but relative to the WEBROOT at /var/...
Paul's user avatar
  • 1,203
3 votes
Accepted

The username used for a failed login attempt is not reported anymore

Yes, it is correct to say that the username is logged only when there is an account matching that username. That is what UserLoginForm::validateFinal() does. // Use $form_state->getUserInput() in ...
apaderno's user avatar
  • 97.5k

Only top scored, non community-wiki answers of a minimum length are eligible