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

How to Pass Dynamic Data Between Drupal Modules Safely?

Hi everyone,

I am developing a custom Drupal module and I need to pass data dynamically from one module to another. For example, Module A generates some user-related data, and Module B needs to use it for custom processing.

Here’s a simplified scenario:

// Module A
function module_a_generate_data($uid) {
$user = \Drupal\user\Entity\User::load($uid);
return [
'username' => $user->getAccountName(),
'roles' => $user->getRoles(),
];
}

Creating node in php script run outside the site UI

I am trying to create content by a script running outside Drupal. I know this is possible, and probably done better, using REST. But the script below is so simple to set up and works very fast that I'd like to try and get it to work in D10->, like it did in D7.  

This code (from the final entry in this post), works to retrieve user and node data, running, for testing purposes, inside the Drupal root folder...

Drupal Headless architecture - Group module performance

Hello,
I'm creating this post to get some feedback or advises based on the following architecture/config:

Ajax Form Rebuild/Clear

Hello all, i have a question regarding ajax forms. I have an ContentEntityForm, that creates a message and displays them on the page immediately. The textfield is cleared successfully, but not the file_field (for image or document uploads) after submit. How we can reset their value after submit?

How to allow anonymous comments on only one (or some) entity type(s)?

I see that I can allow anonymous comments for all comments. But I do not see how to allow such comments on one entity type and not allow on other types.

For example I want to allow anonymous commenting on my 'Story' content but do not want to allow on my 'Recipe' content. 

Please let me know how this should be achieved.

1. via admin UI 
or 
2. by extending/overriding some classes.
I am okay for any such ways.

Thanks

-Mahesh

Drupal + OpenID Connect: how to trigger logout in Drupal when the user logs out from external .NET app / IdP?

I have a Drupal site hosted on the domain https://extranet-mysite.com.

To log in to this site, users go to https://y-authv2.mysite.com/login, which is a .NET application using single sign-on (Authv2). When the user is authenticated, they are redirected back to the Drupal site at https://extranet-mysite.com.

Pages

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