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

How to group Parent fields in Twig?

I have the below data structure:

SOLVED -- custom module routing seemingly not working

Hi, I am attempting to learn Drupal by working my way through Drupal 8: enterprise web development : harness the power of Drupal 8 to create enterprise-grade, highly scalable websites by Nick Abbott. In the chapter about creating custom modules, we are supposed to create and install a custom module whose output is routed to the page /mypage. I followed along exactly, triple-checking the code, but it doesn't work. Instead of getting the output of my module, I get a Page not found error. I checked and there are no published erata for this chapter of the book.

Problem migrating hook_install from Drupal 8 to Drupal 9

I'm porting my first module from Drupal 7 to Drupal 8 and 9, the module itself works, but now I'm stuck on the hook_install. The purpose of my call to hook_install is to create some directories in the public files directory as well as copy some files into them.

In Drupal 7 I used "file_prepare_directory" to create the needed directories. In Drupal 8 this still works, but is advised against since it's deprecated, But it's removed from Drupal 9.x. So I've found it can be replaced by 

Register form block into modal

I want to display the register form in a modal. For that, I created a custom plugin block which returns the rendering of the form register.

How to programmatically create content type with entity reference field in Drupal 8?

Hi,

I am writing a custom module that will create a content type during installation. The content type will have a title and entity reference fields. I know how to create a text fields storage using yml configuration. Here is how I am creating text field storage:

langcode: en
dependencies:
  enforced:
    module:
    - my_module
  module:
  - node
id: node.field_name
field_name: field_name
entity_type: node
type: string
settings:
max_length: 10
module: core
locked: false

/admin/content/media does not load

Sometimes (not always) when I try to access the /admin/content/media page, the page does not load. Instead, it just shows that the domain is registered. It looks like this:

Untitled.png (3410×1290) (ibb.co)

I have about 1000 pictures uploaded there. Does anyone know how to fix this?

Pages

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