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

How to use an exposed views filter without leaving a custom route?

Hi, I've created a report that displays all the file entites that can be found in all the media revisions that aren't the latest revision on my site. This has taken the form of two different view display executions, which are compared and processed ultimately leading to a final result set and that is rendered to my custom route by a third view that adds back pagination and some extra fields I want to include after all the calculations are done. All this takes place in a controller in my custom module.

Use of http_client in a custom middleware

I would like to implement 'http_client_middleware' on Drupal 10 in order to use the cookie to authorize against the API available over HTTPS. For that I need to:

  1. Perform a GET request to login to the API and get the cookie
  2. Use the cookie in following requests to authenticate with the API

I have working code implemented with the controller and now I would like to use it properly with 'http_client_middleware'. I have found a working example in:

Best way to show/hide throbber for an API get request in a custom module?

I want to add throbber on time-taking API calls for the users.
On Drupal 9.5!

Error in Website

I'm getting this error constantly and can't quite figure out what's wrong!

TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in strpos() (line 126 of core/lib/Drupal/Core/Extension/Dependency.php).

How to define _user_is_logged_in: access requirement in routing.yml file

Hello,

When a user navigates to /how I like to check if the user is logged in before displaying the content. I like to define _user_is_logged_in: 'TRUE' access requirement in the routing.yml file to check if the current user is logged in. But I am getting an error when clearing the cache. 

demo.routing.yml:

demo.how:

  path: /how

  defaults:

    _controller: Drupal\demo\Controller\HelloWorldController::how

    _title: 'How page!'

  requirements:

  _user_is_logged_in: 'TRUE'

Error:

Why my template use admin theme instead of front theme ?

 Hello,

[Sorry for my English]

I need to create pdf files from a full HTML to keep my CSS files. I use a template in my module. But if I clear cache on a admin page, my template use admin theme, whereas if I clear cache on a front page, this is the front theme that it used...

How can I choose the theme to use in my template to still have the same theme used by my pdf files?

I want to use my template only with my front theme, and I search a way to fix it.

My code with comments in my controller:

Pages

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