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

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:

`SYSTEM` table was deprecated in MYSQL 8.0

The `SYSTEM` table was deprecated in MYSQL 8.0.

'SYSTEM` table used in _OAUTH_COMMON_VERSION (OAUTH_COMMON.MODULE) in DRUPAL OAUTH 1.0.

Please help me what is the alternative way.

Redirect response is not working

Hello,

I am new to module development. 

If the user is not logged in, I expect the user to redirect to the login page but it is not working. 

\web\modules\custom\demo\src\EventSubscriber:

Pages

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