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

default_value for entity reference in form_alter

Drupal 8.8

In a C.T. I have various entity reference fields and set them with a value taken from another C.T.
The problem is that I can only set it in this way 

$a = Dato();

$form['field_a1']['widget'][0]['target_id']['#value']   = $a;

and it works

Instead I would need to set it in this.

$form['field_a1']['widget'][0]['target_id']['#default_value']   = $a;

but it does not work

User clicked on Add to cart button it should open in Commerce Cart Flyout

Hi,

I want when user clicked on Add to cart button it should open in Commerce Cart Flyout (sidebar cart layout) but as of now it not going to Commerce Cart Flyout.

I also add into block header region when i enable Commerce Cart Flyout then in header region commerce cart (default )featured disappear.

Update alias after edit a node PATHAUTO

I have some content type with a pathauto alias, that is to say, they were created due to a pattern of pathauto.

 I have 2 entities called "Trophy" and "Football", 'Football' has a entity reference field to 'Trophy' and the pattern that it was used to create 'Football' uses the title of 'Thophy'. The problems appears when I update the name of Trophy and the  path alias of Football is outdated, dont update it!

Someone know something about this or how to do this?

Thanks!!

twig: including a variable into an iframe does not work

I have a custom content type with a field for a link. The link is supposed to be shown in an iframe.

in my node--databasemindmap2.html.twig I have the following code:

The "X" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition()

Hii, I'm surfing my website and then I´ve deleted a module called Sports League and a error message appears and I can´t dot nothing.

The following message appears:

Вопрос по Cron

Hello!

It was necessary to create a module that writes Drupal logs using cron and sends them to mail using hook_mail and (or) do_mail. Module created and included, did I do it right and how to see the result. I enclose the code ... THANKS!

cron_log_mail.yml name: 'cron log mail' description: 'simple cron log mail' package: modules_custom type: module core_version_requirement: ^ 8.8 || ^ 9 cron_log_mail.php

Pages

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