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

Add ajax behavior on boolean field to change form mode

Hello,

I want to switch node's form mode by a toggle button (boolean field).

Here is my code:

Redirect custom form to Views page

I'm getting to grips with custom code in D10 after several years of simple development in D7.

What code should you use in the Form Submit function shown below?  (In D7 I think it was $form_state['redirect']='pets'; to send the user to the pets Views listing.

Http DELETE on RestApi Resource leads to null format in symfony\serializer\Encoder\ChainEncoder.getEncoder()

Hello,

I developped a module having as goal to to let's say the basic CRUD operations.

For instance the GET (corresponding to read) is OK, POST (create) is OK and now, for DELETE, I'm face to an error that I've analysed but no reason found yet.

Details about my rest api implementation:

This is my uri_path:

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.

Pages

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