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

[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.

Custom form

I am gaining experience with creating a custom form. I find myself in the need to create a query based on a date and other variables. Not being an expert I am doing the test with only the date.
I created the various files and in the form folder I created the test.php file, where I inserted a date field and a button

How to set cardinality for date field in module config form

Hi,

I am trying to set the cardinality for a date field to allow the user to add multiple dates in my custom module config form (admin/config/beyondBooking). No matter what I try to put in the cardinality field ( I read that 0 means unlimited, and any other value specifies the exact number of values) I still see that the field doesn't support multiple values (I don't see "add another item" with cardinality set to 0 or multiple fields with any another cardinality value). 

Here is my code:

The best plugin to build a user panel in Drupal

I'm looking for a plugin that can build a user page in Drupal and I got acquainted with the following examples but they were not very efficient, you have a better option

Lightning Talk

Thanks for your tips

Need help with Cart events

Hi everyone,

I am working on a module to add optional cancellation insurance with certain products.

I would like to point out right away that I would have liked to use commerce_pado but that it seems incompatible with the bundles created by commerce_vado because you have to choose the type of "add to cart" form and they cannot be combined.

Pages

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