magento2 – Magento 2.4.2 #1 MagentoFrameworkConfigDom->__construct() called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

Hi friends after upgrading to magento 2.4.2, i received the following error in the product catalog.

I am also getting the message “There are no source items with in stock status” when trying to add an item to my cart

Has anyone had the same mistake? Or have you seen this error in previous versions?

error catalog

There are no source items with the in stock status

magento2.3 – Block is rendered, but toHtml() function is not called

Using Magento Commerce 2.3.5-p2.

I’m changing the template of the layered navigation from a custom module like this:

<referenceBlock name="catalog.navigation.renderer"
                                template="Vendor_Module::layer/filter.phtml"/>

This works correctly.

I am displaying images for some filters, and I want to have them lazy-loaded with Magefan_Lazyload.

The module has a plugin in frontend/di.xml:

<type name="MagentoFrameworkViewElementAbstractBlock">
        <plugin name="magefan_lazyload_lock"
                type="MagefanLazyLoadPluginBlockPlugin" sortOrder="1000"/>
    </type>

In my opinion, this should work for all blocks that extend MagentoFrameworkViewElementAbstractBlock, so for example for all MagentoFrameworkViewElementTemplate blocks.

It works for some Template-blocks, but it doesn’t work for some other blocks, such as catalog.leftnav, or the one I am changing above.

I also added debug code to MagentoFrameworkViewElementAbstractBlock::toHtml(), and it seems that this method is never called for my block. Also, I don’t think the toHtml() method is overwritten somewhere.

Any tips?

I am running in developer mode. Strange enough, it works different in production mode – catalog.leftnav is recognized, but still not catalog.navigation.renderer.

I also tried changing the plugin’s sortOrder to 1, this didn’t work either.

theming – Why is my template suggestion not called (the return)?

I have seen many questions like this ones and I have tried all the solutions…

Here is my setup:

1-I have a custom entity with the id defined as follow:

 * @ContentEntityType(
 *   id = "bank_operation",
 *   label = @Translation("Bank Operation"),

2- My hook_theme():

function bank_operation_theme() {
  return (
    'bank_operation' => (
      'render element' => 'elements',
     ),
  );
}

3- My hook_theme_suggestions_HOOK()

function bank_operation_theme_suggestions_bank_operation(array $variables) {
  $suggestions = ();
  $sanitized_view_mode = strtr($variables('elements')('#view_mode'), '.', '_');
  $suggestions() = 'bank_operation__' . $sanitized_view_mode;
  return $suggestions;
}

4- My Route to display the entity with a “receipt” view mode

entity.bank_operation.receipt:
  path: '/bank_operation/receipt/{bank_operation}'
  defaults:
    _entity_view: bank_operation.receipt
    _title: 'Receipt'
  requirements:
    _entity_access: 'bank_operation.view'

5-My twig files:

modules/custom/bank_operation/templates/bank-operation.html.twig
modules/custom/bank_operation/templates/bank-operation--receipt.html.twig

Result: Everything works fine :

receipt view mode is used

-suggestions seems to be correctly added:

<!-- THEME HOOK: 'bank_operation' -->
<!-- FILE NAME SUGGESTIONS:
   x bank-operation.html.twig
   * bank-operation--receipt.html.twig
   x bank-operation.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/custom/bank_operation/templates/bank-operation.html.twig' -->

Except that bank-operation--receipt.html.twig is not called

I have tried all combinations of file name/suggestions/base hook name/… without any success

I have added all the possible twig file name in my templates folder (with or without dash)

I have the feeling that the problem is coming from the fact that the ID of my entity have an underscore in its name…

theming – Why my template suggestion is not called (the return)

I have seen many questions like this ones and I have tried all the solutions…

Here is my setup:

1-I have a custom entity with the id defined as follow:

 * @ContentEntityType(
 *   id = "bank_operation",
 *   label = @Translation("Bank Operation"),

2- My hook_theme():

function bank_operation_theme() {
  return (
    'bank_operation' => (
      'render element' => 'elements',
     ),
  );
}

3- My hook_theme_suggestions_HOOK()

function bank_operation_theme_suggestions_bank_operation(array $variables) {
  $suggestions = ();
  $sanitized_view_mode = strtr($variables('elements')('#view_mode'), '.', '_');
  $suggestions() = 'bank_operation__' . $sanitized_view_mode;
  return $suggestions;
}

4- My Route to display the entity with a “receipt” view mode

entity.bank_operation.receipt:
  path: '/bank_operation/receipt/{bank_operation}'
  defaults:
    _entity_view: bank_operation.receipt
    _title: 'Receipt'
  requirements:
    _entity_access: 'bank_operation.view'

5-My twig files:

modules/custom/bank_operation/templates/bank-operation.html.twig
modules/custom/bank_operation/templates/bank-operation--receipt.html.twig

Result: Everything works fine :

receipt view mode is used

-suggestions seems to be correctly added:

<!-- THEME HOOK: 'bank_operation' -->
<!-- FILE NAME SUGGESTIONS:
   x bank-operation.html.twig
   * bank-operation--receipt.html.twig
   x bank-operation.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/custom/bank_operation/templates/bank-operation.html.twig' -->

Except that bank-operation--receipt.html.twig is not called

I have tried all combinations of file name/suggestions/base hook name/… without any success

I have added all the possible twig file name in my templates folder (with or without dash)

I have the feeling that the problem is coming from the fact that the ID of my entity have an underscore in its name…

Galera quando chamo o metodo de calculos aparece o erro The method ‘calculos’ was called on null. Receiver: null Tried calling: calculos()

import ‘package:flutter/material.dart’;
import ‘package:mini_conf/app/componentes/formularios_componentes.dart’;
import ‘package:mini_conf/app/models/Modulo_analises.dart’;
import ‘package:flutter/cupertino.dart’;

class Resultados extends StatefulWidget {
@override
_ResultadosState createState() => _ResultadosState();
}

class _ResultadosState extends State {
Widget _body() {
return ListView(
children: (
SizedBox(height: 100),
Center(
child: Image.asset(
‘assets/imagens/logo.png’,
width: 130,
height: 130,
),
),
SizedBox(height: 50),
Image.asset(‘assets/imagens/linha.png’),
Divider(),
Formularios("PV:", repv),
Divider(),
Formularios("GPV/Kg/dia:", regpv),
Divider(),
Formularios("IMS/Vol./Kg/dia:", reimsv),
Divider(),
Formularios("IMS/Conc./Kg/dia:", reimsc),
Divider(),
Formularios("% Volumoso:", rervolumoso),
Divider(),
Formularios("% Concentrado:", rerconcentrado),
Divider(),
Formularios("Quant. de animais:", reqanimais),
Divider(),
Formularios("Cons. de água/dia:", recagua),
Image.asset(‘assets/imagens/linha.png’),
Center(
child: Text(‘% Composição/dia’,
style: TextStyle(
fontFamily: ‘Volkhov’, fontSize: 20, color: Colors.white)),
),
Divider(),
Formularios("%Volumoso:", reporv),
Divider(),
Formularios("%Conc. fixado:", reporcf),
Divider(),
Formularios("%2ºConcentrado:", reporcs),
Divider(),
Formularios("%3ºConcentrado:", reporct),
Divider(),
Formularios("%Minerais:", repnucle),
Divider(),
Formularios("%Enchimento:", reporcau),
Divider(),
Center(
child: Text(‘% Nutrientes’,
style: TextStyle(
fontFamily: ‘Volkhov’, fontSize: 20, color: Colors.white)),
),
Formularios("NDT%:", rendt),
Divider(),
Formularios("PB%:", repb),
Divider(),
Formularios("Ca/g:", reca),
Divider(),
Formularios("P/g:", rep),
Divider(),
Formularios("Total/IMS:", reims),
Divider(),
Image.asset(‘assets/imagens/linha.png’),
Center(
child: Text(‘Quantitativo da dieta/dia’,
style: TextStyle(
fontFamily: ‘Volkhov’, fontSize: 20, color: Colors.white)),
),
Divider(),
Formularios("Volumoso Kg:", rekgvolumoso),
Divider(),
Formularios("Conc. fixado Kg:", rekgfconcentrado),
Divider(),
Formularios("2ºConcentrado Kg:", rekgsconcentrado),
Divider(),
Formularios("3ºConcentrado Kg:", rekgtconcentrado),
Divider(),
Formularios("Minerias Kg:", rekgminerais),
Divider(),
Formularios("Enchimento/kg:", rekgcau),
Divider(),
Formularios("Total Kg:", rekgtotal),
Image.asset(‘assets/imagens/linha.png’),
Center(
child: Text(‘Custo da dieta/dia’,
style: TextStyle(
fontFamily: ‘Volkhov’, fontSize: 20, color: Colors.white)),
),
Divider(),
Formularios("Volumoso:", repvolumoso),
Divider(),
Formularios("Conc. fixado:", repfconcentrado),
Divider(),
Formularios("2ºConcentrado:", repsconcentrado),
Divider(),
Formularios("3ºConcentrado:", reptconcentrado),
Divider(),
Formularios("Minerias:", repminerais),
Divider(),
Formularios("Enchimento:", repenchimento),
Divider(),
Formularios("Total:", rectotal),
Image.asset(‘assets/imagens/linha.png’),
SizedBox(height: 60),
RaisedButton(
color: Colors.lightBlue,
onPressed: () {},
child: Text(‘Nova Formulação’,
style: TextStyle(
fontFamily: ‘Volkhov’,
))),
SizedBox(height: 60),
),
);
}

final TextEditingController reqanimais = TextEditingController();
final TextEditingController recagua = TextEditingController();
final TextEditingController regpv = TextEditingController();
final TextEditingController rekgvolumoso = TextEditingController();
final TextEditingController rervolumoso = TextEditingController();
final TextEditingController reimsv = TextEditingController();
final TextEditingController rekgfconcentrado = TextEditingController();
final TextEditingController rekgsconcentrado = TextEditingController();
final TextEditingController rekgtconcentrado = TextEditingController();
final TextEditingController rerconcentrado = TextEditingController();
final TextEditingController reimsc = TextEditingController();
final TextEditingController repvolumoso = TextEditingController();
final TextEditingController repfconcentrado = TextEditingController();
final TextEditingController repsconcentrado = TextEditingController();
final TextEditingController reptconcentrado = TextEditingController();
final TextEditingController repminerais = TextEditingController();
final TextEditingController rectotal = TextEditingController();
final TextEditingController rendt = TextEditingController();
final TextEditingController repb = TextEditingController();
final TextEditingController reca = TextEditingController();
final TextEditingController rep = TextEditingController();
final TextEditingController rekgminerais = TextEditingController();
final TextEditingController reims = TextEditingController();
final TextEditingController repv = TextEditingController();
final TextEditingController repnucle = TextEditingController();
final TextEditingController rekgcau = TextEditingController();
final TextEditingController repocau = TextEditingController();
final TextEditingController reporv = TextEditingController();
final TextEditingController reporcf = TextEditingController();
final TextEditingController reporcs = TextEditingController();
final TextEditingController reporct = TextEditingController();
final TextEditingController repormi = TextEditingController();
final TextEditingController reporcau = TextEditingController();
final TextEditingController repototal = TextEditingController();
final TextEditingController repenchimento = TextEditingController();
final TextEditingController rekgtotal = TextEditingController();
Analises analises;

// ignore: non_constant_identifier_names
Resultados() {
analises = Analises(
rekgtotal: rekgtotal,
reqanimais: reqanimais,
recagua: recagua,
regpv: regpv,
rekgvolumoso: rekgvolumoso,
rervolumoso: rervolumoso,
reimsv: reimsv,
rekgfconcentrado: rekgfconcentrado,
rekgsconcentrado: rekgsconcentrado,
rekgtconcentrado: rekgtconcentrado,
rerconcentrado: rerconcentrado,
reimsc: reimsc,
repvolumoso: repvolumoso,
repfconcentrado: repfconcentrado,
repsconcentrado: repsconcentrado,
reptconcentrado: reptconcentrado,
repminerais: repminerais,
rectotal: rectotal,
rendt: rendt,
repb: repb,
reca: reca,
rep: rep,
rekgminerais: rekgminerais,
reims: reims,
repv: repv,
repnucle: repnucle,
rekgcau: rekgcau,
repocau: repocau,
reporv: reporv,
reporcf: reporcf,
reporcs: reporcs,
reporct: reporct,
repormi: repormi,
reporcau: reporcau,
repototal: repototal,
repenchimento: repenchimento,
);
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: (
SizedBox(
height: MediaQuery.of(context).size.height,
child: Image.asset(
‘assets/imagens/resultados.jpg’,
fit: BoxFit.cover,
),
),
_body()
),
),
);
}
}

functional analysis – Are functions called ‘periodic’ only if they repeat on $xin mathbb{R}$ .

I got that doubt when I came across the following problem.

Let f(x)=min({x-1},{1-x}) $forall$ x $in$ (-3,3), where {x} represents fractional part of x.Then which of the following is true:
1)ƒ(x) is continuous function $forall$ x $in$ (-3,3)
2)ƒ(x) is a periodic function
3)$int_{-3}^3$f(x)dx=$frac32$
4)ƒ(x) is an even function.

This is how solved.
Following is the graph of the function.
enter image description here

Now option 1),3) and 4) are correct.
But the author says that option 2) is incorrect, which leads me to a conclusion(doubt) that are function said to be periodic if and only if they are repeating in $xin mathbb{R}$. As it is obvious from the graph of the function that it is periodic I would like to know whether my reasoning and the author are correct?

wp_enqueue_script was called incorrectly. Scripts and styles

I am not a developer, but I have a theme that is giving me the error wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks.

I have read some solutions where they suggest to change to do:

    function ppibfi_enqueue_scripts() {
   wp_enqueue_script( 'jquery' );
   wp_enqueue_script( 'thickbox' );
   wp_enqueue_script( 'media-upload' );
}
function ppibfi_enqueue_styles(){
    wp_enqueue_style( 'thickbox' );
}
add_action( 'wp_enqueue_scripts', 'ppibfi_enqueue_scripts' );
add_action( 'wp_enqueue_scripts', 'ppibfi_enqueue_styles' );

But the code in my website does not start with the same like a function it just states:

//load scripts
wp_enqueue_script('smoothscroll', get_bloginfo('stylesheet_directory').'/includes/js/smoothscroll.js', array('jquery'), '');
//wp_enqueue_script('carrosel', get_bloginfo('stylesheet_directory').'/js/infinite-carousel.js', array('jquery'), '');
wp_enqueue_script('marker', get_bloginfo('stylesheet_directory').'/includes/map/js/marker.js', array('jquery'), '');
//wp_enqueue_script('carrouse', get_bloginfo('stylesheet_directory').'/includes/js/carrousel.js', array('jquery'), '');
wp_enqueue_script('tinycar', get_bloginfo('stylesheet_directory').'/js/jquery.tinycarousel.min.js', array('jquery'), '');

and

// fix google map in the header issue
function googlemaphome() {
    if ( is_front_page()  ) {
       wp_register_script ('googlemaps', 'http://maps.google.com/maps/api/js?&sensor=false', false, '3');
    }
}
add_action('wp_enqueue_scripts', 'googlemaphome');

and 

add_action( 'wp_enqueue_scripts', 'jt_style_changer' );

 //load the responsive style
 function responsive_styles()
{ wp_enqueue_style('responsive', get_stylesheet_directory_uri() . '/styles/responsive.css',false,'1.0','all');}
add_action('wp_print_styles','responsive_styles');

Does anybody know how to rewrite so there is no error? Any help would be appreciated as I am not a developer.

unreal 4 – How to pass parameters to a Blueprint function called from C++?

I have found this piece of code showing how to call a blueprint function from C++:

 UFUnction* Func = Obj->GetClass()->FindFunction(FName("FuncName"));
 if(Func == nullptr){return;}
 
 FStructOnScope FuncParam(Func);
 UProperty* ReturnProp = nullptr;
 
 for (TFieldIterator<UProperty> It(Func); It; ++It)
    {
     UProperty* Prop = *It;
     if (Prop->HasAnyPropertyFlags(CPF_ReturnParm))
     {
         ReturnProp = Prop;
     }
     else
     {
         //FillParam here            
     }
 }
 
 Obj->ProcessEvent(Func, FuncParam.GetStructMemory());

But… I don’t know how to //Fillparam here.

How can I fill the FuncParam with the parameters that I need to pass?