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

Only cache children of render array

I have a custom select query, which I then render into a list. This looks somewhat like this:

$build['content'] = [
  '#type' => 'container',
];

foreach ($results as $result_item) {
  $build['content'][] = [
    '#type' => 'container',
    '#theme' => 'container__custom_item_theme',
    '#result' => $result_item,
  ];
}

The query cannot be cached, as it is very dynamic. A single result item however looks the same every time (considering it is the same item).

Trying to debug module on TFA

Hi, previously I submitted a question about TFA issues, not sure if anyone faces this before. link: https://www.drupal.org/project/tfa/issues/3383019

Nor I have much php experience to debug this TFA session expired issue. Any advice/suggestion would be appreciated.

Custom Menu Template not Rendering Menu Links

I'm building a custom module that modifies the main theme (barrio bootstrap in this case) to establish a landing page. In that process, it hides blocks in some regions and takes over rendering the main menu.

When I try to replace the default menu template used by the primary menu, "menu--main.html.twig" with my own template "mymenu--main.html.twig" that is exactly the same, it doesn't render the menu links. It is using my designated template, but for some reason it's not rendering the same.

search api custom normalizer

Using contrib module search api, I use also the format "Entity (Search API)" in order to generate my rest export result of view.

And i get the result below. I want to know

Change custom field from one module to another

Hello,
I have a situation where I have a custom field (myfield) that was initially defined in Module 1. Some fields have been created with it. That field is now defined in Module 2 instead (i.e. Module 1 no longer defines or does anything with that field).

The problem I'm having is that, despite everything about the field being exactly the same, I can't uninstall Module 1 because it thinks there are fields that require it. If I create a new field of type myfield, it correctly assumes it is part of Module 2.

XML-RPC

Hi Guys, 
I'm using xmlrpc_encode_request() this method in Drupal 7 and now I migrated my site to Drupal 9 and I want to use this method. How to use the same ? 
I'm using like this: 

Pages

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