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

Hook for intercept edit user save and redirect on my api

Hello community !

I looking for, the good code for intercept and redirect the save button (/user/1/edit) on my api.

i try this :

How to get session_id in hook_user_login ?

The question is in the title !
I need session_id in hook_user_login.
I can get user name, user id, but no success for sessionid

 I tried  $session_id = \Drupal::service('session')->getId(); //empty

Thanks in advance for your help 

Edit: If I cannot get the id, how can I get the hash that is stored in base ?.

 

Attachments to emails sent with commerce_email module

I'm using the commerce_email module, to send emails to customers upon events fired.

When an order is complete, I do send an email to the customer with info about tracking codes and so o, and want to attach an pdf with further info about tracking, is that possible, and how ?

Thank you in advance.

Do I need to write a Module/Snippet? (Newbie)

Building my first Drupal site. Drupal 10.

I have a Content Type called "Kind of Things", say, which has a field "Amount of these kind of Things", say.

I'd like to construct a block which displays a count of nodes in "Kind of Things" and a sum of the integer fields "Amount of these kind of Things".

Something like "There are 56 different kinds of things, a total of 1089 things in all".

Module says email was sent but system says it was not

Suddenly, our production system has stopped sending most emails. The logs just show “error sending email”, but on the page after you submit a form, it says “Unable to send email. Contact the site administrator if the problem persists.” . This happens when a user signs up for an account and on a custom module I created. There are no errors in the system maillog file.

To try to debug, I installed the simple Send Mails module. It sends mail without issue! Looking at its code and my custom module’s code, the mailManager call is almost the same.

Missing cache context from local tasks (tabs)

As title suggest local tasks by default adds "route" cache context but my client somehow avoided it. All tabs on all pages looks the same.

I am struggling to recreate this issue and I suspect this is random case because it happened more than once in last 2-3 weeks, but it seems random. Before that everything was working fine for ages. I am using Drupal 10.2.2.

Any idea or lead how this happened would help, because I am running out of ideas. Thanks in advance.

https://i.stack.imgur.com/OOS3H.png

Pages

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