Magento 2, How to avoid the automatic update / recharge of the billing address, while adding information to the fields in the new billing address?

Magento 2, How to avoid the automatic update / recharge of the billing address, while adding information to the fields in the new billing address?

python 3.x – Grouping form fields using Django Crispy Forms

I am trying to group fields in Django Model Form like this. But it doesn't work in model form. Is it possible to group? How do i do it?

class RegisterForm(forms.ModelForm):
    class Meta:
        model = People;
        exclude = ('isverified',)

    def __init__(self, *args, **kwargs):
        super(RegisterForm, self).__init__(*args, **kwargs)
        self.helper = FormHelper()
        self.helper.layout = Layout(
            Fieldset('Group 1',
                     Field('field1'),
                     Field('field2')),
            Fieldset('Data 2', 
                     Field('field3'))

website design: how many input fields in a row of a form?

If you really want columns in your forms

Here is a quick rule to follow when designing forms with multiple columns:

double the size of the font and enter the largest realistic value the input would need to accept, if it fits then your input is big enough.

The reason for this is that a lot of people will increase the font size in their browser and WCAG 1.4.4, although not entirely clear, suggests that this should allow a size increase of up to 200%.

I say it is not clear as it says as long as the page can be expanded and this has always been a point of discussion on what the rule really means.

Even if this point is not clear, it is good practice.

Assuming you're using rem or em units in 1rem / 1em, just set font-size: 200% in your HTML and enter the longest realistic information you can think of (i.e. for the email address enter & # 39; thisisalongemailaddress@alongdomainname.com'), if set, it is gold.

Since the font size is complex with rems, ems, etc., you can set the font size to 32px manually on each input, as that would be the equivalent. Don't forget your labels too to check that they work.

If you find you have a lot of space left, add another entry to the row if it makes sense.

A couple of additional considerations.

Also, since it's marked as & # 39; accessibility & # 39 ;, make sure the edge of your posts has at least a 3: 1 contrast ratio to the environment, it looks good at a glance, but it's on the edge .

One last thing to consider is if the items go together. Name and surname, but is the identification number related? I would be tempted to have an ID number on a different line.

Should I design forms with more than one column?

Having said all of the above … put one entry on one line.

By the time you start adding error messages, all of the above will fall apart (since error messages tend to be longer).

Error messages should still work in larger font sizes and tend to be unclear when they have 2 or 3 columns.

Also, don't worry about vertical scrolling, it's a convention today and since a form will end with a submit button, people will know when they have reached the end of your form (so you don't have to worry about missing people fields.)

After creating the first list with choice fields, I can't search for those fields: how do I maintain data integrity and still links?

Stack Exchange Network

The Stack Exchange network consists of 175 question and answer communities, including Stack Overflow, the largest and most trusted online community for developers to learn, share their insights, and develop their careers.

Visit Stack Exchange

8 – Control the visibility of the paragraph without fields

I am preprocessing a paragraph to add a custom form, but I am having visibility issues. I don't need any field in this paragraph.

If I just add the form to the paragraph, the whole paragraph is hidden from anonymous users.

function my_module_preprocess_paragraph__my_paragraph(&$variables) {
  $paragraph = $variables('paragraph');
  $form = Drupal::formBuilder()->getForm('Drupalmy_moduleFormMyCustomForm');
  $variables('content')('form') = $form;
}

However, if I add a title field to that paragraph, everything appears fine. Is there a way I can display the form without adding fields?

8 – Is a block rendering array built with EntityViewBuilderInterface :: view supposed to represent the entire block template or just the internal fields?

After rendering custom blocks in templates, I got this js error: Quick Edit failed to associate markup of rendered entity field. What I have done so far:

To repeatedly represent custom blocks in templates, I wrote this function in mytheme.theme :

function render_block_in_template($block_id) {
  // $block = Drupal::entityTypeManager()->getStorage('block_content')->load($block_id);
  $block = Drupalblock_contentEntityBlockContent::load($block_id);

  if(!empty($block)) {
    $block_content = Drupal::entityTypeManager()
      ->getViewBuilder('block_content')
      ->view($block);

    if($block_content) {
      // kint($block_content);
      return $block_content;
    }
  }
}

And called him mytheme_preprocess_node :

function mytheme_preprocess_node(&$variables) {
  $node = $variables('node');

  if($node->bundle() == 'some_bundle') {
    $variables('some_block') = render_block_in_template(12);
    $variables('some_other_block') = render_block_in_template(13);
    // ...
  }
}

Then I render the blocks in node--some-bundle.html.twig :

{{ some_block }}
{{ some_other_block }}

So far so good. But I got this js error from quickedit.js:

Error: Quick edit failed to associate rendered entity field marking
(with (data-quickedit-field-id="block_content/12/body/fr/full")) with
corresponding processed entity markup: parent DOM node not found
with (data-quickedit-entity-id="block_content/12"). This is typically
caused by the theme template for this type of entity forgetting
print the attributes.

What brought me to this problem: Custom Block Interrupt Design Builder Module: Quick Edit was unable to associate rendering entity field markup, but applying the patch didn't change anything, and further reading allows me to think that this is not exactly related.

If I {{ kint(some_block) }} In twig, the #attributes key with the expected values ​​is here:

enter the image description here

and this is the HTML output:

// FIELD CONTENT

Lastly, wrapping it manually with the following eliminates the error:

So it seems that the above part of the envelope The block template is not rendered, only the fields are and cause the error.

Is there really a mistake or am I doing things wrong?

payment – required fields are required but not shown in shipping address

I'm using magento 2.3.3, when I try to send the chekout request it doesn't show some fields and gives me:

Please verify the shipping address information. "firstname"It is required. Please log in and try again."lastname"It is required. Please log in and try again."city"is required. Please log in and try again.

please help

8 – Is a block processed from EntityViewBuilderInterface :: view supposed to represent a complete block template or just internal fields?

To repeatedly represent custom blocks in templates, I wrote this little function in mytheme.theme :

function render_block_in_template($block_id) {
  // Both work below
  // $block = Drupal::entityTypeManager()->getStorage('block_content')->load($block_id);
  $block = Drupalblock_contentEntityBlockContent::load($block_id);

  if(!empty($block)) {
    $block_content = Drupal::entityTypeManager()
      ->getViewBuilder('block_content')
      ->view($block);

    if($block_content) {
      // kint($block_content);
      return $block_content;
    }
  }
}

And called him mytheme_preprocess_node :

function mytheme_preprocess_node(&$variables) {
  $node = $variables('node');

  if($node->bundle() == 'some_bundle') {
    $variables('some_block') = render_block_in_template(12);
    $variables('some_other_block') = render_block_in_template(13);
    // ...
  }
}

Then I render the blocks in node--some-bundle.html.twig :

{{ some_block }}
{{ some_other_block }}

So far so good. But I got this js error from quickedit.js:

BUG: Quick Edit Failed to Associate Processed Entity Field Markup
(with (data-quickedit-field-id = "block_content / 12 / body / fr / full")) with
corresponding processed entity markup: parent DOM node not found
with (data-quickedit-entity-id = "block_content / 12"). This is typically
caused by the theme template for this type of entity forgetting
print the attributes.

What brought me to this problem: Custom Block Interrupt Design Builder Module: Quick Edit was unable to associate rendering entity field markup, but applying the patch didn't change anything, and further reading allows me to think that this is not exactly related.

If I {{ kint(some_block) }} In twig, the #attributes key with the expected values ​​is here:

enter the image description here

and this is the HTML output:

// FIELD CONTENT

Lastly, wrapping it manually with the following eliminates the error:

So it seems that that part of the block template container is not rendered, just the fields. Is that correct ? Is there really a mistake or am I doing things wrong?

Vulnerability scanners – what's the best way for OWASP Zap to handle unique fields and API sequences?

First situation: Proxy through some zap requests and I want to do active analysis on them. Zap Active Browsing works on one property at a time, and this particular request requires that some of the properties be unique per request.

For example, a username can only be used once in the registry, which pattern in zap would be best to tell the active scan to change this property for each scan request?

Second situation: This is similar to the first, but somewhat different. I have APIs that need to be done in a sequence of steps. For example, Step 1, Step 2, Step 3, To make the request for Step 3, Step 1 and Step 2 must be completed. To achieve an optimal active scan in Step 3, for each active scan request, the Step 1 and Step 2 would have to be done before each request. What would be the best way to accomplish this?

python – flask-admin creates the form and disables some fields in the edit form

A flask manager form is created with all fields enabled and editable.
However, I would like to render the edit mode so that the user can only edit one of the form fields.

Using this unfortunately disables all but one field (as expected for editing) but also in the create form.

form_widget_args = {
    "control": {"readonly": True, "disabled": True},
    "from_dt": {"readonly": True, "disabled": True}, 
    "column": {"readonly": True, "disabled": True}, 
    "values": {"readonly": True, "disabled": True}
}

How to enable all fields in create mode while disabling a subset of those in edit mode?