7 – Add a custom attribute to an external JS script

It's not really clear how to add custom attributes when adding an external JS script to the page.

Currently, I have this code:

drupal_add_js('https://code.jquery.com/jquery-3.4.1.js', array('type' => 'external'));

How can I add a integrity to assign to the rendered script tag?

The rendered script should look like this:


I know that this post exists, but I am not able to use this solution because the source code is loaded from the outside and I will not be able to check the source code.

jQuery: Remove the checked attribute from a radio button

On my website on music, I have a voting system consisting of radio buttons:



    " : ">";
        }

    ?>


So, if the user has already voted (via jQuery and .ajax()) a song, the corresponding radio button appears checked when updating the web:

enter the description of the image here

enter the description of the image here

Well, I try to edit my script so that if the user clicks the radio button marked, checked vanish:

$('input(type=radio):checked').click(function()
{
    $(this).attr('checked', false);
})

And apparently it works, the attribute checked disappears:

enter the description of the image here

enter the description of the image here

The problem is that if you then click on another radio button (in this case, 1, 2, 3 or 5), you change the vote, then click again on the initial radio button (on 4), the DOM continues to assume this is the checked and delete the vote again (although now it is no longer a 4, but another value of the five possible).

I feel that it has to do with the differences between .attr() and .prop()but I found myself stuck in the beginning, see if you can give me a cable.

virtualtype – Depends on an attribute field on the field of another attribute in the administrative form Magento2

This block describes the dependence of the possibility of changing field 1, the value of field2. After running this code, the dependency will not be created, exactly the problem here

'disabled' => '!${$.provider}:' . self::DATA_SCOPE_PRODUCT. ".field2:value"```
if you remove "!", then the field will become inaccessible in any case
$meta = $this->arrayManager->merge(
                $weightPath . static::META_CONFIG_PATH,
                $meta,
                (
                    'dataScope' => 'field1',
                    'additionalClasses' => 'admin__field-small',
                    'imports' => $disabled ? () : (
                        'disabled' => '!${$.provider}:' . self::DATA_SCOPE_PRODUCT
                            . ".field2:value"
                    )
                )
            );

Display the customer attribute according to the customer group in the Magento 2 administrator

I'm trying to hide / show a client attribute based on the value of the client group, but can not find which function I should replace?

Thank you !

digital integration – Why would NIntegrate attribute a negative value to this strictly positive integration?

enter the description of the image here

NIntegrate(
 Exp(Log((a/3 - c/3) (a/3 - b/2 + c/6) (a/3 + b/2 + c/6)) + 
    1/2 (-((15 a^2)/4) - (15 b^2)/4 - (5 c^2)/4)) Boole(
   c >= b >= 0) Boole(c >= a), {a, -Infinity, Infinity}, {b, 0, 
  Infinity}, {c, 0, Infinity})

The integrand is an exponential (plus some Boole terms that should not affect the sign of the integrand), that is, it is strictly positive, so why is the result negative?

What I found while searching: the result becomes positive if I delete the first term of the logarithm, $ ( frac {a} {3} – frac {c} {3}) $. The restriction imposed by the second term of Boole, $ c geq to $, force this term to be strictly negative, which can be problematic because the logarithm of a negative number is complex and the integration is done only on real numbers. However, this should not be fatal because logarithm contains three terms that are multiplied. Although this term is negative, others could also be negative to give a positive value.

This is not as if these values ​​did not exist: for example $ a = 1, b = 2, c = $ 3 satisfies both conditions of Boole, is in the integration range and gives a positive value for the logarithm:

enter the description of the image here

(a/3 - c/3) (a/3 - b/2 + c/6) (a/3 + b/2 + c/6) /. {a -> 1, b -> 2, 
  c -> 3}

Because this point exists, it seems that the digital integral should also (and should be positive).

What's up?

Google adds new options to rel = NOFOLLOW attribute

When introducing nofollow, Google would ignore links marked this way as a signal to use in our search algorithms. This has now changed. All link attributes [sponsored, UGC, and nofollow] are treated as indications of which links to consider or exclude in the search.

magento2.3 – Magento 2.3: Create a custom category attribute with WYSIWYG

I want to add WYSIWYG-compatible text boxes as custom fields for categories. I have read all related topics on this site for this issue, but none of the answers mentioned seem to do the business. Can someone see what I'm doing wrong?

Note: This is Magento 2.3 – The module works, the attributes are created correctly, the data is correctly saved, but the WYSIWYG does not show up.

/app/code/MyCompant/CategoryFields/Setup/InstallData.php

class InstallData implements InstallDataInterface
{

    private $eavSetupFactory;
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(('setup' => $setup));
        $eavSetup->addAttribute(
            Category::ENTITY,
            'sm_category_faq1_content',
            (
                'type' => 'varchar',
                'label' => 'FAQ1 Content',
                'input' => 'textarea',
                'required' => false,
                'sort_order' => 102,
                'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_STORE,
                'is_wysiwyg_enabled' => true,
                'is_html_allowed_on_front' => true,
                'global' => ScopedAttributeInterface::SCOPE_STORE,
                'group' => 'General Information',
            )
        );
    }
}

/app/code/MyCompany/CategoryFields/view/adminhtml/ui_component/category_form.xml

    
Custom Content true 10 MagentoCatalogUiComponentCategoryFormElementWysiwyg wysiwyg FAQ1 Content bold,italic,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code false false false false false 250px false false false false ui/form/field category true sm_category_faq1_content 12 8

magento2 – How can I display the data of a custom client attribute in a custom payment method?

I've created a basic personalized payment method called a credit card on file. Our credit card processing is done in an internal system. Therefore, on the payment method, I just have to indicate the last four digits of the credit card to the record. I've already created the custom attribute on the client entity to store the four digits. I would now like to display this value in the payment method, if it exists for the customer.

What is an attribute range in data mining?

In my data mining course, we work with a dataset. I have to identify the ranges of each attribute. I am given the data set for the 150 points and given the visualization (diagrams) of all the attributes. However, I do not know how to use this dataset or graphics to find the ranges for each attribute. I do not know what we mean by range either.

I am working on the dataset for iris plants and I have three classes of the flower.

magento2 – Magento 2 – Disable the payment method according to the client attribute

I have a custom offline payment method that I want to display based on a customer attribute value. Finally, I want to check this value against the total and if it is less than the total, disable the method. But the first thing is first, I can not get the client attribute. I'm testing with group_id which in this case is 1. Here's what I've got:

etc> events.xml


    
        
    

    
        
    

and my observer:

_customerRepositoryInterface = $customerRepositoryInterface;
    $this->_logger = $logger;
  }

  /**
   * @param Observer $observer
   *
   * @return void
   */
  public function execute(
    MagentoFrameworkEventObserver $observer
    )
  {

    $result = $observer->getEvent()->getResult();
    $method_instance = $observer->getEvent()->getMethodInstance()->getCode();
    $quote = $observer->getEvent()->getQuote();

    if($method_instance == 'payroll')
    { 
      $customer = $this->_customerRepositoryInterface->getById($quote->getCustomer()->getId());
      if($customer->getCustomAttribute('group_id')->getValue() == 1)
      {
        $result->setData('is_available', false);
      }
    }
  }
}

I receive this error:

& # 39; Uncaught Error: Calling a member function getValue () on null in DisablePayment.php

What am I doing wrong?