Scenario: There are four tabs on a webpage. Each tab contains a webform. Some of the fields are required.

If a user doesn’t complete a required field on tab two, and clicks tab four without saving, what should happen?

1. The user is prevented from going to tab four until the required field is filled in
2. The user is permitted to go to tab four, and tab two reverts to its previous information (all changes to tab two are discarded; there might even be a warning dialog before this happens)
3. Something else

(I don’t like putting webforms in tabs, but I’ve had to work on software that was set up this way.)

Posted on

## Views plugin to freely distribute fields

For D9 Views block I look for a plugin to be able to freely distribute the fields in a Bootstrap layout.

Is anything like thar around?

Posted on

## algebraic number theory – Extension of morphism in local fields of positive characterisic

Consider $$theta:mathbb F_q(T)mapstomathbb F_q(T)$$ defined by $$theta(Q)=Q(T^q)$$. It is a morphism of fields. Let $$P$$ be an irreducible polynomial of $$mathbb F_q(T)$$. Then, $$theta$$ can be uniquely extended to $$mathbb F_q(T)_P$$ by continuity (denote it $$theta$$ again), where $$mathbb F_q(T)_P$$ is the completion of $$mathbb F_q(T)$$ for the topology induced by the $$P$$-valuation . It is a morphism of fields yet and for every $$xin K_P$$, one has $$theta(x)=x^q$$.
My question: can $$theta$$ be extended continuously to $$Omega_P$$, the topological closure of an algebraic closure $$overline{K_P}$$ of $$K_p$$ such that $$theta$$ is a morphism of fields in $$overline{K_P}$$ and $$theta(x)=x^q$$ for any element $$xinoverline{K_P}$$?

Posted on

## rest – Why SharePoint ListItemAllFields not returning all fields?

Using the following I can see all properties and column values for documents in my library/folder except for one.

``````_api/web/GetFolderByServerRelativeUrl('/mylibrary/myfolder')/Files?\$expand=ListItemAllFields
``````

Its a typical lookup column, and it exists in all my libraries.
When I try the above it shows up in the properties, whether a value is assigned or not, in every library in the site collection except one.

``````<d:PackageId m:null="true" />
``````

Why? I can’t see any setting or config that makes this library different than the others.
A dozen custom columns, including lookups, but just this one doesn’t appear.

Posted on

## Plotting translated vector fields from user-defined functions

I have two time- and space-dependent vector fields, one which is:

$$mathbf A(x,y,t) = -y , t , hat{mathbf x} + x , t , hat{mathbf y}, tag 1$$

and another $$mathbf B(x,y,t)$$ which is $$mathbf A$$ translated $$3/2$$ units in the positive $$hat{mathbf x}$$ direction and $$3/2$$ units in the positive $$hat{mathbf y}$$ direction, so:

$$mathbf B(x,y,t) = – left( y – dfrac{3}{2} right) , t , hat{mathbf x} + left( x – dfrac{3}{2} right) , t , hat{mathbf y}. tag 2$$

I want to plot $$mathbf B$$ evaluated at $$t = 1$$ in Mathematica. I tried two different ways but only one worked. The first one is directly from the expression (2):

$$mathbf B(x,y,1) = – left( y – dfrac{3}{2} right) , hat{mathbf x} + left( x – dfrac{3}{2} right) , hat{mathbf y}. tag 3$$

The resulting plot correctly shows the translation in both axes:

``````StreamPlot({3/2 - y, -(3/2) + x}, {x, -5, 5}, {y, -5, 5})
`````` The second way I plot $$mathbf B(x,y,1)$$ is by first defining $$mathbf A$$ and then translating it. However, the resulting plot only shows $$mathbf A$$ translated in the $$hat{mathbf x}$$ direction, even though `B(1)` gives the same expression as (3):

``````Clear(A, B);
A(t_) := {-y*t, x*t};
B(t_) := ReplaceAll(ReplaceAll(A(t), x -> x - 3/2), y -> y - 3/2);
B(1)
StreamPlot(B(1), {x, -5, 5}, {y, -5, 5})
`````` Note that if you use the function `VectorPlot` instead of `StreamPlot`, the error is still present in the second method.

Why the second method didn’t work? I want to fix it because I’m also using Mathematica to automatically translate the field $$mathbf A$$.

Given that `B(1)` is the same expression as (3), I think the problem is related with user-defining `B`.

Posted on

## 8 – How to set default form fields value from controller

Add the default values to getForm():

``````return \$this->formBuilder()->getForm('DrupalmymoduleFormMyForm', \$default1, \$default2);
``````

And set the default values in the form class:

``````class MyForm extends FormBase {

public function buildForm(array \$form, FormStateInterface \$form_state, \$default1 = NULL, \$default2 = NULL) {

\$form('field1') = (
'#type' => 'textfield',
'#title' => \$this->t('Field 1'),
'#default_value' => \$default1,
);

// ...

}
}
``````

## domain name system – what are the record fields in dig “ANSWER SECTION”?

domain name system – what are the record fields in dig “ANSWER SECTION”? – Server Fault

## 9 – How to change fields order in node ds view?

I am using Drupal 9. My task is to reorder node default display (I am using DS module) fields’ order depends on some conditions. I have tried to do it by hook_ds_pre_render_alter() hook. Here my code

``````/**
* Implements hook_ds_pre_render_alter().
*/
function ancestors_main_ds_pre_render_alter(&\$layout_render_array, &\$context, &\$variables) {
if (!empty(\$context('bundle')) && \$context('bundle') === 'event_and_heritage_tour') {
foreach(\$layout_render_array as \$region => &\$fields) {
if (\$region === 'field_event_and_tour_media') {
\$fields('#weight') = 2;
}
}
}
}
``````

Is there any way to solve my problem?

## 8 – How can I capture a field’s configs and storage so I can delete it and then re-create it?

I’m trying to implement this in a `hook_update_N()` but I’m not sure it’s proper (see excerpt below). Note I’m changing max_length in the process.

What I’m trying to do: update my_custom_entity.field_my_custom_field which has saved data into it. So I need to:

1. Store that data
2. Store the field configs – if that’s possible?
3. Store the field storage – if that’s possible?
4. Delete the field
5. Create the field again using stored configs and storage
6. Restore the saved data
``````  // Capture the existing field configs.
\$new_field = \$field->toArray();
\$new_field('field_type') = 'string';
\$new_field('settings') = ();

// Capture the existing field storage.
\$new_field_storage = \$field_storage->toArray();
\$new_field_storage('type') = 'string';
\$new_field_storage('settings') = (
'max_length' => \$field_length,
'is_ascii' => FALSE,
'case_sensitive' => FALSE,
);

// Delete existing field + field storage and purge data.
\$field_storage->delete();
field_purge_batch(150);

// Create new field using captured configs/settings.
\$new_field_storage = FieldStorageConfig::create(\$new_field_storage);
\$new_field_storage->save();

\$new_field = FieldConfig::create(\$new_field);
\$new_field->save();
``````

Posted on

## php – Can I add checkout fields already on the product page so that the customer can add this information and later be retrieved at checkout?

I’m trying to make some woocommerce checkout fields available on the product page, such as: First Name, Last Name, Telephone and E-mail.

What I need is that when the customer fills in these fields on the woocommerce product page, this information will already be included in the checkout so that it speeds up the filling of other billing information.

What I’ve done so far is to manually add the fields to the file …/woocommerce/single-product/simple.php

``````    <label>Full Name</label></br>
<input type="text" id="billing_first_name" placeholder="Enter your full name"></input></br>

<label>Email</label></br>
<input type="text" id="cpf" placeholder="Enter your email"></input></br>

<label>Phone</label></br>
<input type="text" id="tel" placeholder="A contact phone number"></input></br></br>

<button type="submit" name="add-to-cart" value="<?php echo esc_attr( \$product->get_id() ); ?>" class="single_add_to_cart_button button alt"><?php echo esc_html ( \$product->single_add_to_cart_text() ); ?></button>
``````

Not if that would be the best way to do it… But when I fill in the data and click on the button: add to cart

I don’t retrieve the values ​​in the fields on the cheout page

Posted on