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

Webform submission redirect

Hi all. I have a question around redirects and how to implement them. So my use-case is, if a user accesses a webform which has a draft webform submission associated with it, on the pre-load I want to run some logic check and under certain circumstances I want to redirect the user away from the webform. I have tried looking into the kernel event for loading the page, but the request that comes back is just for the webform itself and not its submission. Does anyone know how to load the current user's submission when the webform route is requested?

Condition for custom fields

Hi guys.

Sorry to bother you again, but i swear i tried everything and with lots and lots of internet searches.
I've already managed to read the base of Drupal by php, but I can't, in any way, put the value of a custom field as a condition of the query.
Can anyone help me, please?
Thank you very much!

The code:

$query = \Drupal::database()->select('node', 'n');

$query->addField('n', 'nid');

$query->condition('type','code_page');

$query->condition('n.field_code_area_de_negocios','text to search');

Connecting SOLR search to Google Analytics

We are running Drupal 9 and wondered if our SOLR search could be improved by connecting it to Google Analytics which we use. Our search results aren't pulling back the most popular pages on our site with filtering by relevance. We are in the process of switching SOLR to Acquia SOLR.   thx.

Scott

Disable blocks

Hi guys.

I've been posting my questions here and I've been very happy with the quick responses and your great willingness to help me. (sorry my "google translator english", rsrs)

Now I need to know a simple question: in Drupal 7 we have the "disable block" to use as we want, in some block/area of the current theme.

But, in Drupal 10, I can't find the "disabled" blocks area in "admin/structure/block".

cache

Hello I have written a controller for data visualization.
Before I upgraded to version 9.4.3, when I made a change to a node the data display through the controller was right
I upgraded ala version 9.5.5 (but already from the previous 2), the data display through the controller is not exact.
If I change the title or a field of a node and launch the controller, it does not display the updated data but the previous one.
I am forced to launch cache clearing first to get the exact display.
How can I do to solve the problem ?

Just put a php code in a page

I guys, I have a very basic question.

In Drupal 7 I was a very har user of php code inside a page (I know I'm a crazy dude), and this way I buid a lot of functionalities (believe me).

Now that I want to be a really Drupal developer (at my 58 years old), I can't believe that I can't have a simple way to put my php code and print on a page in a simple module.

Until now, I just see weird ways to put code in variables and return this in functions.

Can you teach me the most simple way to process a php code and print on a page on a custom module?

Pages

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