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

Activate Drupal 10 from crontab

Hello friends.
Unfortunately I'm here again asking for help.
I know I've already spent my two tokens on questions, but I leave here my supplications for new doubts.
This time I searched for everything and not even ChatGPT could help me.
What I want, and I already did this in Drupal 7, is, through crontab, to activate a function inside a Drupal 10 module, fully activating Drupal, to execute the code in a module.
I found 3 solutions on the Internet, but none of the 3 works.
Important consideration:

Populating Paragraph with List of authors (Twig)

I am stuck on this problem:

I have a content type authors with fields: field_authorname, field_authorpicture, field_authorbio.
Then I have a paragraph type: author_selection with field_author (referenced type authors)

In contenttype news the field field_news_content is paragraph author_selection selected.

now I want to show field_authorname, field_authorpicture, field_authorbio by use of a twig template.

I just don't get the values of the paragraph. 

Anyone can help? 
Thx

Wanted: even more advanced Drupal developer setup

I would like to be able to find the origin of an error like

[Saving a node]
Warning: Array to string conversion in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::castValue() (line 2579 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).

in a minute or two.

I just spent two hours discovering that the error came from a contrib module.

I've got a setup on a Linux workstation with a local MySQL, Apache, Xdebug, VS Code (with a gazillion extensions)... And still I resorted to lowly trial and error.

No Markup filter

Hi guys.

Sorry for my crazy and basic questions.

I'm trying to put a form in a very simple custom block.

But I believe the "#markup" is filter my form.

Can someboby help me specific in make off this filter for me? Like "noMarkup" or something...

Thank you!! (I know it's is a very bad practice, but please!).

THE CODE:

<?php
namespace Drupal\bloco_simples\Plugin\Block;
use Drupal\Core\Block\BlockBase;

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');

Pages

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