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

visual tree

Hello everyone!
Can I create such a page in Drupal?
Who knows? help me please:

https://drive.google.com/file/d/1-VXLIABGN4R5JqfRbJNqmFLTtuFt5rvw/view?u...

Unable to use SameSite=none with secure attribute in D8, using Symfony\Component\HttpFoundation\Cookie to create the cookie

Hi There,

I am trying to create a cookie in D8.9 with SameSite=none with secure attribute in D8, using Symfony\Component\HttpFoundation\Cookie class but unable to do so as the class doesn't allow the secure attribute along with none. Also, I tried setting the Cookie's secure parameter to TRUE but it results in infinite redirects in my site. Don't want to implement the solution on site level as it will affect other cookies capabilities. I just want to do this for one particular cookie I am creating. Is there anyone who can help on this. Thanks in advance.

Switching to D8/D9 from D7

Hello guys,

I did some module development in D7, and now I am going through the initial struggle of the switch.

I am a part-time Drupal developer and In Drupal 7 I was able to print_r($view) under hooks to understand the structure of an array/object. This is what I used majorly to find my way around D7.

Similar approach isn't working in drupal 8.

For instance under hook_fixes_views_pre_view() print_r($view) doesn't print anything.

How do I reference images through CSS in a library within a module?

Hi.

I have created a module, added a library, added CSS and JS.

The CSS and JS load correctly. However the images referenced in the CSS file aren't loaded. Drupal is looking for them at the wrong path.

Under mymodule.libraries.yml

[Solved] How to edit $form_state value in hook_form_alter

I was able to read value from a $form_state object using

$first = $form_state->get("field_first_value");

but various attempts of updating this value have failed

$form_state->set($form['field_second_value'], $first)

and

$form_state->setValueForElement($form['field_second_value'], $first);

and even

Embedding php file from node

I have written some PHP code that I want to include in a node. All is done on a local install.

In drupal 7 I was used to do that using

<?php
include_once ("includes/my_includes/myfile.php");
?>

In Drupal 9 with Text format: Full HTML with PHP the following code doesn't include php file

include_once ("themes/custom/mytheme/my_includes/myfile.php");

What would be the successful way of doing this from node body.

Pages

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