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

D8 block visibility and caching

I want to hide a block under certain conditions. The code works, but only if I flush the caches after the condition changes. I guess I have to do something with the cachablity of the block, but I'm not sure how. Any ideas?

Here's the code:

How to query an external, non-drupal Database

Hey,

I want to query an external sqlite Database. This Database does not contain Drupal information, or Drupal specific tables. It jus holds some data, I want to display on my website.

How can I integrate the database?

So far, I added it to setting.php:

$databases['external']['default'] = [
  'driver' => 'sqlite',
  'database' => '/gesamtausgabe_2019.sqlite',
];

And then, I try to call it in my Controller.php file:

question about inject core service in custom class.

HI:

I‘m little confusing about the injection of core services in my class.

I have a module, named with helloworld. And in the helloworld.service.yml  file ,i have the service defined like this:

services:
  HelloWorld.salutation:
    class: Drupal\helloworld\HelloWorldSalutation
    arguments: ['@current_user', '@config.factory']

In my HelloWorldSalutation class ,i have a __construct() function to inject the core services:

Can you help me create a module that lists user tasks ?

Hi, I want to create a module that lists the user tasks, for the entities "User", "Drupal Commerce" and "Group".

I have a Drupal 8.9 site with the Drupal Commerce and Group modules :

https://www.drupal.org/project/commerce

https://www.drupal.org/project/group

I want to create a task list on the following pages :

Drupal 9 "View the administration theme"

The tick box  "View the administration theme" is not available on the drupal 9.01 permissions page. I've looked at a couple of instances on my localhost dev and can't find it, searched a couple of databases and can't find it.
Am I missing something or is it not available?

How to allow only the current user to see his own page ?

I created a page in a custom module. I want only the current user to access this page on their behalf.

For example, I am using it with ID 51. If I go to :

/user/51/tasks

I can see this page.

If I go on :

/user/78/tasks

I must have an error 403 access denied.

How to do this ?

Pages

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