This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to check inside code if the site is managed by Composer?

Hi

I need a piece of if-code which does the following:

if (site is managed by Composer) {

// do some stuff here

}

Any idea how to do this check with code?

Drupal 10 development books

Recently, two Drupal 10 development books have been released which is great news.

Drupal 10 Development Cookbook

Written by Matt Glaman and Kevin Quillen, the book was released February 2023, and is getting good reviews.

Unable to enable module that has been generated with drush generate

I have a strange problem and can't find an answer on the forum.

I tried to follow the steps of the Drupal Handbook to generate an content  entity module by doing the following steps:

drush generate entity:content 

After this i have the following file Structure:

[Advice] Consume JSON:API Data, Save and Display

Hey Drupal Developers,

I have recently taken up a task to do the following:

  1. Set up a custom module
  2. Consume an API once a day
  3. Save it to the database
  4. Retrieve the data and display where ever necessary

Attempt 1:

  • I created a custom block.
  • Overided the block in the theme, e.g block--block.html.twig.
  • Added JS to fetch and customized the data to suit.
  • The realized I had no way to save it or access the Drupal API to save the data.

Attempt 2:

Way to query all nodes that use a specific paragraph field?

I am trying to find all nodes that use a specific paragraph field (populated) in order to replace each instance with a different field type. Can't seem to be able to get what I need with a view and I'm not quite sure if I can get to where I need in the db. Any suggestions on a way to get them in a hook/twig?

Getting Ajax error : "data-error-switching-to-ckeditor5" in Drupal 10

Hello,

I'm currently working on a module and having the folowing error

"data-error-switching-to-ckeditor5"

This error happens when I am in a "text and format editor" and when I do one of the following : 
- Add/Remove the the module icon from the toolbar
- Click on the module checkbox in the "Enabled filters" area
- Switch the "Text editor" between CKEditor5 and none

The code worked fine on drupal 9.5 with CKeditor but going to drupal10 with CKEditor5 raised this error

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions