Change default Imagesize for all graphics functions programmatically only for the current session

How do I change the default Imagesize for all functions producing graphics programmatically for the current session (only)?

Something close to an answer is given in https://mathematica.stackexchange.com/a/15270/45020 but it either only changes the output of one function (such as Plot) or the solution uses the Frontend Menu instead of code.

FTP Disabled by Default in cPanel Version 86

Hi,

im not sure when cpanel post it [URL="https://cpanel.net/up-next/ftp-disabled-by-default/"]https://cpanel.net/up-next/ftp-disabled-by-d… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1818649&goto=newpost

8 – Paragraph’s fields value loaded in a custom controller are in the default language instead of the current language

I made a custom controller that load a paragraph field from a node and then render some part in a template. The paragraph field field_title and field_description are translatable.

The translation works fine on the admin side. I followed https://www.drupal.org/docs/8/modules/paragraphs/multilingual-paragraphs-configuration and I can see the content is translated from the admin. But my controller only loads the default language value instead of the current language.

<?php

/**
 * @file
 * Contains DrupalMyModuleControllerMyModuleController.
 */

namespace DrupalMyModuleController;

use DrupalCoreControllerControllerBase;
use SymfonyComponentHttpFoundationJsonResponse;
use SymfonyComponentHttpFoundationRequest;

class MyModuleController extends ControllerBase {
    
    /**
     * Controller load the game
     * 
     * @return DrupalMyModuleControllerRedirectResponse
     */
    public function gameView() {
        
        $nid = 1;
        
        // Load the game
        $game = Drupal::entityTypeManager()->getStorage('node')->load($nid);
                
        $stages = ();
        
        // Get all the stages of the game
        $paragraph_field_items = $game->get('field_stages')->getValue();
        if (!$paragraph_field_items) {
            throw new SymfonyComponentHttpKernelExceptionNotFoundHttpException('This game has no level');
        }
            
        // Get storage for paragraph
        $paragraph_storage = Drupal::entityTypeManager()->getStorage('paragraph');
        // Collect paragraph field's ids.
        $ids = array_column($paragraph_field_items, 'target_id');
        // Load all paragraph objects.
        $paragraphs_objects = $paragraph_storage->loadMultiple($ids);

        /** @var DrupalparagraphsEntityParagraph $paragraph */
        foreach ($paragraphs_objects as $paragraph) {
          // Get field from the paragraph.

          $description = (
              '#type' => 'processed_text',
              '#text' => $paragraph->get('field_description')->value,
              '#format' => 'basic_html',
          );

          $stages () = (
              'title' => $paragraph->get('field_title')->value,
              'image' => $paragraph->get('field_image'),
              'description' => $description,
              'east_lv95' => $paragraph->get('field_east_lv95')->value,
              'north_lv95' => $paragraph->get('field_north_lv95')->value,
          );
        }
        
                  
        return (
            '#theme' => 'game_map',
            '#party' => $party,
            '#stages' => $stages,
            '#game' => $game,
        );
    }

How to change default error messages (for example for Import)

I am having trouble locating the origin of an error message of an Import that fails to find the appropriate file in a script that is running on a cluster. I do not have access to the Frontend there and I fail to reproduce the error when using the Frontend.

Unfortunately the error message only prints:

Import::nffil: File not found during Import.

It does not say which file was not found. I would like to include that information in the error message. How do I change the error message to this effect?

Is it recommended to drop all traffic by default in iptables after accepting only what is required?

Let me be blunt: “default deny” is the best practice. The concept is that the firewall blocks all traffic, and only allows the specific traffic that is approved.

But wait! What could those people mean that it doesn’t add anything?

It’s logic: without the DROP, if a packet does not match any rule, then the firewall doesn’t do anything with it. There is no instruction for what to do with it. So it should just die, right?

However

That assumes that the system will behave in a consistent and predictable way when there is no matching rule. But you cannot be so sure about that.

A default deny rule is a safety net that ensures that the firewall will act like a firewall.

magento2 – set default filter status on sales order grid, not working

i try set default filter status on sales order grid with this code:

app/code/FP/Orders/Model/ResourceModel/Order/Grid/Collection.php

<?php

namespace FPOrdersModelResourceModelOrderGrid;

use MagentoFrameworkDataCollectionDbFetchStrategyInterface as FetchStrategy;
use MagentoFrameworkDataCollectionEntityFactoryInterface as EntityFactory;
use MagentoFrameworkEventManagerInterface as EventManager;
use PsrLogLoggerInterface as Logger;

use MagentoSalesModelResourceModelOrderGridCollection as OriginalCollection;

/**
 * Order grid extended collection
 */
class Collection extends OriginalCollection
{
    /**
     * @var MagentoBackendModelAuthSession
     */
    protected $_adminSession;
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        MagentoBackendModelAuthSession $adminSession,
        $mainTable = 'sales_order_grid',
        $resourceModel = MagentoSalesModelResourceModelOrder::class
    ) {
        $this->_adminSession = $adminSession;
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }
    
   protected function _renderFiltersBefore()
   {
    $objectManager = MagentoFrameworkAppObjectManager::getInstance();
    $request = $objectManager->get("MagentoFrameworkAppRequestHttp");
 
    $module_controller_action = $request->getActionName();
    if($module_controller_action == 'send'){
      $this->getSelect()->where("status = 'processing'");
    }else if($module_controller_action == 'fact'){
      $this->getSelect()->where("status = 'pending'");
    }
    parent::_renderFiltersBefore();
   }
}

This code does not work but, this one that I leave below does work.
I don’t understand why when “$this->getSelect()->where(” status = ‘pending’ “);” it is executed inside the conditional does not work, help please

<?php

namespace FPOrdersModelResourceModelOrderGrid;

use MagentoFrameworkDataCollectionDbFetchStrategyInterface as FetchStrategy;
use MagentoFrameworkDataCollectionEntityFactoryInterface as EntityFactory;
use MagentoFrameworkEventManagerInterface as EventManager;
use PsrLogLoggerInterface as Logger;

use MagentoSalesModelResourceModelOrderGridCollection as OriginalCollection;

/**
 * Order grid extended collection
 */
class Collection extends OriginalCollection
{
    /**
     * @var MagentoBackendModelAuthSession
     */
    protected $_adminSession;
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        MagentoBackendModelAuthSession $adminSession,
        $mainTable = 'sales_order_grid',
        $resourceModel = MagentoSalesModelResourceModelOrder::class
    ) {
        $this->_adminSession = $adminSession;
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }
    
   protected function _renderFiltersBefore()
   {
    
    $this->getSelect()->where("status = 'pending'");
    parent::_renderFiltersBefore();
   }
}

my app/code/FP/Orders/view/adminhtml/layout/orders_sales_fact.xml

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <body>
       <referenceContainer name="content">
            <uiComponent name="sales_order_grid"/>
            <settings>
                <filterUrlParams>
                    <param name="status">processing</param>
                </filterUrlParams>
            </settings>
        </referenceContainer>
    </body>

</page>

my app/code/FP/Orders/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoFrameworkViewElementUiComponentDataProviderCollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="sales_order_grid_data_source" xsi:type="string">FPOrdersModelResourceModelOrderGridCollection</item>
            </argument>
        </arguments>
    </type>
</config>

Replace the default modal with a different one

I want to replace Drupal 8 default modal with MDB.

How I can do it? Should I unload default library for modals and load new one? Any idea?

Do Chrome and Firefox show Inspect / Inspect Element in their context menus by default?

I’m writing some instructions on how to work around a broken modal on Duolingo by deleting some HTML. I’m trying to write it so non-techy people can follow along.

On Safari I found I had to go to Preferences > Advanced and enable developer tools for the “Inspect” context menu item to start appearing.

What about Chrome and Firefox? I’ve used both Chrome and Firefox for so long that I can’t remember if I enabled developer tools at some point or, they just have Inspect / Inspect Element by default. I see that I continue to have this option in Incognito Mode and after signing out of my Chrome browser account, but I’m not confident that there isn’t some local setting affecting this.

Does someone know for sure if a brand new installation of Chrome and Firefox would still have the Inspect / Inspect Element context menu item?

Issue with changing the default font language from x-unicode to x-western in Thunderbird

How are we suppose to change the default language from x-unicode to x-western which is enclosed within the <body> of the mail content. Here below is the content of incoming Email when outgoing Email is sent to the same Email ID.

Incoming Email needs to be changed

From

<div class="moz-text-html" lang="x-unicode">

To

<div class="moz-text-html" lang="x-western">

enter image description here

While sending & receving it changes to x-unicode instead of x-western
How are suppose to achieve this?

SharePoint list Default forms – Showing horizontal align when I tried to open in new window(modern sites),How to make it vertical align

SharePoint list Default forms Showing horizontal align when I tried to open in new window(modern sites),How to make it vertical align

enter image description here